docs: def api_errors_to_messages(request, error, fallback_text):
      """
      Adds messages for each error returned from the MTP apis
      Useful for displaying errors when there's no form on the page
      :param request: HttpRequest
      :param error: HttpClientError
      :param fallback_text: fallback error text
      """
      try:
          response_body = json.loads(error.content.decode('utf-8'))
          for field, errors in response_body.items():
              if isinstance(errors, list):
                  for error in errors:
                      messages.error(request, error)
              else:
                  messages.error(request, errors)
      except (AttributeError, ValueError, KeyError):
          messages.error(request, fallback_text)