def spiceFoundExceptionThrower(f):
@functools.wraps(f)<EOL>def wrapper(*args, **kwargs):<EOL><INDENT>res = f(*args, **kwargs)<EOL>if config.catch_false_founds:<EOL><INDENT>found = res[-<NUM_LIT:1>]<EOL>if isinstance(found, bool) and not found:<EOL><INDENT>raise stypes.SpiceyError("<STR_LIT>".format(f.__name__), found=found)<EOL><DEDENT>elif hasattr(found, '<STR_LIT>') and not all(found):<EOL><INDENT>raise stypes.SpiceyError("<STR_LIT>".format(f.__name__), found=found)<EOL><DEDENT>else:<EOL><INDENT>actualres = res[<NUM_LIT:0>:-<NUM_LIT:1>]<EOL>if len(actualres) == <NUM_LIT:1>:<EOL><INDENT>return actualres[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>return actualres<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>return res<EOL><DEDENT><DEDENT>return wrapper<EOL>
Decorator for wrapping functions that use status codes