Skip to content

Commit

Permalink
Merge pull request #397 from mfocko/backticks-to-apostrophes
Browse files Browse the repository at this point in the history
Switch backticks to apostrophes in Pagure errors

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
  • Loading branch information
softwarefactory-project-zuul[bot] authored Apr 26, 2020
2 parents 5d10f5d + 3389345 commit 3fbdbdc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ogr/services/pagure/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def call_api(
else None
)
raise PagureAPIException(
f"Page `{url}` not found when calling Pagure API.",
f"Page '{url}' not found when calling Pagure API.",
pagure_error=error_msg,
)

Expand All @@ -147,13 +147,13 @@ def call_api(
if "error" in response.json_content:
error_msg = response.json_content["error"]
error_msg_ext = response.json_content.get("errors", "")
msg = f"Pagure API returned an error when calling `{url}`: {error_msg}"
msg = f"Pagure API returned an error when calling '{url}': {error_msg}"
if error_msg_ext:
msg += f" - {error_msg_ext}"
raise PagureAPIException(
msg, pagure_error=error_msg, pagure_response=response.json_content,
)
raise PagureAPIException(f"Problem with Pagure API when calling `{url}`")
raise PagureAPIException(f"Problem with Pagure API when calling '{url}'")

return response.json_content

Expand All @@ -168,7 +168,7 @@ def call_api_raw(

except requests.exceptions.ConnectionError as er:
logger.error(er)
raise PagureAPIException(f"Cannot connect to url: `{url}`.", er)
raise PagureAPIException(f"Cannot connect to url: '{url}'.", er)
return response

def get_raw_request(
Expand Down

0 comments on commit 3fbdbdc

Please sign in to comment.