#2242 python: return the correct message when all request attempts fail
Merged 2 years ago by frostyx. Opened 2 years ago by frostyx.
copr/ frostyx/copr invalid-login  into  main

file modified
+2 -2
@@ -65,8 +65,8 @@ 

                  if response.status_code == 401:

                      self._update_auth_params(request_params, auth, reauth=True)

                      continue

-                 return response

-         raise CoprRequestException("Unable to connect to {0}.".format(self.api_base_url))

+                 break

+         return response

  

      def _request_params(self, endpoint, method=GET, data=None, params=None,

                          headers=None, auth=None):

Build succeeded.

Do we want to have this in two places (send, and the inner _send_request_repeatedly()?

1 new commit added

  • python: handle request errors only once
2 years ago

You are right, it is enough to have just one handle_errors call. PTAL.
If you like this change better, I will squash the commits.

Build succeeded.

rebased onto 32b7c26af63b6ec023ec9f8eca82078ab037c33f

2 years ago

Build succeeded.

rebased onto 5572bff

2 years ago

Build succeeded.

Pull-Request has been merged by frostyx

2 years ago
Metadata