From 1a0e9b1da07d67f72eeadf1d5cf36dcc69cb3db9 Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Mar 25 2019 14:08:34 +0000 Subject: [PATCH 1/2] pass "errors" to exc in != 200 Signed-off-by: Tomas Tomecek --- diff --git a/libpagure/libpagure.py b/libpagure/libpagure.py index ea59577..db68b9d 100644 --- a/libpagure/libpagure.py +++ b/libpagure/libpagure.py @@ -94,7 +94,10 @@ class Pagure(object): 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): From bfa50fa098245fdae60fef568e49cf26047f6038 Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Mar 25 2019 14:08:34 +0000 Subject: [PATCH 2/2] fix flake8 error Signed-off-by: Tomas Tomecek --- diff --git a/libpagure/libpagure.py b/libpagure/libpagure.py index db68b9d..8ff0e6a 100644 --- a/libpagure/libpagure.py +++ b/libpagure/libpagure.py @@ -592,7 +592,8 @@ class Pagure(object): 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