Skip to content

Commit

Permalink
feat: display exception msg in the API response if any
Browse files Browse the repository at this point in the history
  • Loading branch information
asadali145 committed Dec 5, 2024
1 parent 27d313c commit d8e4718
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions courses/views/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ def get(self, request, *args, **kwargs): # noqa: ARG002
try:
data = fetch_emeritus_courses()
return Response(data, status=status.HTTP_200_OK)
except Exception: # noqa: BLE001
except Exception as e: # noqa: BLE001
return Response(
{"error": "Some error occurred."},
{"error": str(e)},

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
)

0 comments on commit d8e4718

Please sign in to comment.