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:
parent
c0b9013576
commit
1997f164b8
1 changed files with 2 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue