diff --git a/furbaby/api/views.py b/furbaby/api/views.py index ae73f7e..7468fa4 100644 --- a/furbaby/api/views.py +++ b/furbaby/api/views.py @@ -257,6 +257,16 @@ def update_location_record(self, request): }, status=status.HTTP_404_NOT_FOUND, ) + except Exception as e: + return json_response( + data={ + "error": "something went wrong while updating the location record", + "error message": str(e), + "location id": location_id, + "user id": request.user.id, + }, + status=status.HTTP_500_INTERNAL_SERVER_ERROR, + ) def delete_location_record(self, request): try: @@ -276,6 +286,16 @@ def delete_location_record(self, request): }, status=status.HTTP_404_NOT_FOUND, ) + except Exception as e: + return json_response( + data={ + "error": "something went wrong while deleting the location record", + "error message": str(e), + "location id": location_id, + "user id": request.user.id, + }, + status=status.HTTP_500_INTERNAL_SERVER_ERROR, + ) @api_view(["GET", "POST", "OPTIONS", "PUT", "PATCH", "DELETE"])