def checkForSpiceError(f):
    """
    Internal function to check
    :param f:
    :raise stypes.SpiceyError:
    """
    if failed():
        errorparts = {
            "tkvsn": tkvrsn("TOOLKIT").replace("CSPICE_", ""),
            "short": getmsg("SHORT", 26),
            "explain": getmsg("EXPLAIN", 100).strip(),
            "long": getmsg("LONG", 321).strip(),
            "traceback": qcktrc(200)}
        msg = stypes.errorformat.format(**errorparts)
        reset()
        raise stypes.SpiceyError(msg)
Internal function to check
    :param f:
    :raise stypes.SpiceyError: