Skip to content

Commit

Permalink
added proper exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
wmelder committed Mar 8, 2024
1 parent 7531420 commit 2872d9a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/apis/resource/resource_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ def get(self, identifier, cat_type="program"):
return APIUtil.toErrorResponse(
"bad_request", "Invalid resource level supplied"
)
except Exception:
print("test")
except Exception as e:
logger.exception(
f"Unknown error while generating lod resource uri for {ResourceApiUriLevel(cat_type)} and {identifier}."
)
return APIUtil.toErrorResponse("internal_server_error", e)

if mime_type is MimeType.HTML:
logger.info(f"Generating HTML page for {lod_url}.")
Expand Down

0 comments on commit 2872d9a

Please sign in to comment.