<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def log_and_reraise_smt_request_failed(action=None):
 """Catch SDK base exception and print error log before reraise exception. msg: the error message to be logged. """

    try:
        yield
    except exception.SDKSMTRequestFailed as err:
        msg = ''
        if action is not None:
            msg = "Failed to %s. " % action
        msg += "SMT error: %s" % err.format_message()
        LOG.error(msg)
        raise exception.SDKSMTRequestFailed(err.results, msg)