<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def a_capture_show_configuration_failed(ctx):
 """Capture the show configuration failed result."""

    result = ctx.device.send("show configuration failed")
    ctx.device.last_command_result = result
    index = result.find("SEMANTIC ERRORS")
    ctx.device.chain.connection.emit_message(result, log_level=logging.ERROR)
    if index > 0:
        raise ConfigurationSemanticErrors(result)
    else:
        raise ConfigurationErrors(result)