code: def _raise_fail(self, response, expected):
          
          try:
              if self.logger:
                  self.logger.error("Status code "
                                    "{} != {}. \n\n "
                                    "Payload: {}".format(response.status_code,
                                                         expected,
                                                         response.content))
              raise TestStepFail("Status code {} != {}.".format(response.status_code, expected))
          except TestStepFail:
              raise
          except:  # pylint: disable=bare-except
              if self.logger:
                  self.logger.error("Status code "
                                    "{} != {}. \n\n "
                                    "Payload: {}".format(response.status_code,
                                                         expected,
                                                         "Unable to parse payload"))
              raise TestStepFail("Status code {} != {}.".format(response.status_code, expected))
docs: Raise a TestStepFail with neatly formatted error message