Skip to content

Commit

Permalink
feat: add default error message in case the request to hathor core fails
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroferreira1 committed Aug 20, 2024
1 parent 71346f6 commit 39a0278
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion handlers/node_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,12 @@ def nc_blueprint_source_code(
response = node_api.get_nc_blueprint_source_code(blueprint_id)

if response is None or "error" in response:
message = response.get("error") if (response and "error" in response) else ""
default_message = "Unknown error when retrieving blueprint source code"
message = (
response.get("error")
if (response and "error" in response)
else default_message
)
raise ApiError(message)

return {
Expand Down

0 comments on commit 39a0278

Please sign in to comment.