code: def handle_error(self, exc, msg):
          
          if self.mode == "api":
              logger.error(msg)
              if self.strict:
                  raise exc
          elif self.mode == "cli":
              sys.stderr.write(msg)
              sys.exit(1)
docs: Determine how to handle an error and what message to
          display to the user.
          :param exc: Exception
          :param msg: str, the message to display to the user
          :return: None