#2206 frontend: don't mislead users upon error 500
Merged 2 years ago by praiskup. Opened 2 years ago by praiskup.

file modified
+1 -1
@@ -1773,7 +1773,7 @@

  

  

  def _handle_frontend_api_request_error(e, args):

-     if "Request is not in JSON format" not in str(e):

+     if "is not in JSON format" not in str(e):

          return

      if not args.debug:

          sys.stderr.write("Try 'copr-cli --debug' for more info.\n")

file modified
+1 -1
@@ -147,5 +147,5 @@

              # pylint: disable=raise-missing-from

              raise CoprTimeoutException(message, response=response)

  

-         raise CoprRequestException("Request is not in JSON format, there is probably a bug in the API code.",

+         raise CoprRequestException("Response is not in JSON format, there is probably a bug in the API code.",

                                     response=response)

"Request is not in JSON format" sounds like the user did something
wrong, while it is clearly a server-side problem.

Reported-by: Jiří Popelka jpopelka@redhat.com

Build succeeded.

Pull-Request has been merged by praiskup

2 years ago