diff --git a/courses/views/v1/__init__.py b/courses/views/v1/__init__.py index db41df1da..b1daca1bb 100644 --- a/courses/views/v1/__init__.py +++ b/courses/views/v1/__init__.py @@ -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)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR, )