1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 14:59:36 +02:00

Handle exceptions in search method with a generic error message

This commit is contained in:
Sean Morley 2025-05-24 18:08:58 -04:00
parent c0b9013576
commit 1997f164b8

View file

@ -42,8 +42,8 @@ class ReverseGeocodeViewSet(viewsets.ViewSet):
else:
results = search_osm(query)
return Response(results)
except Exception as e:
return Response({"error": str(e)}, status=500)
except Exception:
return Response({"error": "An internal error occurred while processing the request"}, status=500)
@action(detail=False, methods=['post'])
def mark_visited_region(self, request):