def handle_error(errcode):
if type(errcode) is c_int:<EOL><INDENT>errcode = errcode.value<EOL><DEDENT>if errcode == <NUM_LIT:0>:<EOL><INDENT>pass  <EOL><DEDENT>elif errcode == -<NUM_LIT:1>:<EOL><INDENT>raise TimeoutError("<STR_LIT>")<EOL><DEDENT>elif errcode == -<NUM_LIT:2>:<EOL><INDENT>raise LostError("<STR_LIT>")<EOL><DEDENT>elif errcode == -<NUM_LIT:3>:<EOL><INDENT>raise InvalidArgumentError("<STR_LIT>")<EOL><DEDENT>elif errcode == -<NUM_LIT:4>:<EOL><INDENT>raise InternalError("<STR_LIT>")<EOL><DEDENT>elif errcode < <NUM_LIT:0>: <EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>
Error handler function. Translates an error code into an exception.