#39 Propagate more errors from pagure API to APIError
Merged 5 years ago by cverna. Opened 5 years ago by ttomecek.
ttomecek/libpagure fix-pagure-4300  into  master

file modified
+6 -2
@@ -94,7 +94,10 @@ 

          if req.status_code != 200:

              LOG.error(output)

              if "error_code" in output:

-                 raise APIError(output["error"])

+                 if "errors" in output:

+                     raise APIError("%s, details: \"%s\"" % (output["error"], output["errors"]))

+                 else:

+                     raise APIError(output["error"])

          return output

  

      def create_basic_url(self):
@@ -589,7 +592,8 @@ 

  

          return return_value["activities"]

  

-     def create_pull_request(self, title, branch_to, branch_from,

+     def create_pull_request(

+             self, title, branch_to, branch_from,

              initial_comment=None):

          """

          Create pull-request

rebased onto 1a0e9b1

5 years ago

Pull-Request has been merged by cverna

5 years ago
Metadata