code: def error(self, exc):
          
          msg = 'trying to execute a step in the environment: \n' \
                '           - Exception: %s' % exc
          if self.logger is not None:
              self.logger.error(msg)
          self.by_console('      ERROR - %s' % msg)
docs: log an error message:
          :param exc: exception message