def check_error(context: RunContext) -> int:
if context.return_code != <NUM_LIT:0>:<EOL><INDENT>if context.mute:<EOL><INDENT>context.result_buffer += f'<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>context.result_buffer += f'<STR_LIT>'<EOL><DEDENT>_LOGGER_PROCESS.error(context.result_buffer)<EOL>_LOGGER_PROCESS.error(repr(context))<EOL>if not context.failure_ok:<EOL><INDENT>_exit(context)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if context.mute:<EOL><INDENT>context.result_buffer += f'<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>context.result_buffer += f'<STR_LIT>'<EOL><DEDENT>_LOGGER_PROCESS.info(context.result_buffer)<EOL><DEDENT>return context.return_code<EOL>
Runs after a sub-process exits

Checks the return code; if it is different than 0, then a few things happen:

    - if the process was muted ("mute" is True), the process output is printed anyway
    - if "failure_ok" is True (default), then a SystemExist exception is raised

:param context: run context
:type context: _RunContext
:return: process return code
:rtype: int