# Improve exception reporting for API

* fixes typo in exception_reporter.py
* properly catches error on geometry cast into multipolygon if input are no valid polygons
* extends error response on malicious api calls
* specifies different exceptions on try-catch while initializing api data
This commit is contained in:
2025-12-19 14:17:15 +01:00
parent 047c9489fe
commit 328f672ec0
5 changed files with 15 additions and 8 deletions

View File

@@ -81,9 +81,7 @@ class AbstractAPIView(View):
Returns:
"""
content = [error.__str__()]
if hasattr(error, "messages"):
content = error.messages
content = [f"{error.__class__.__name__}: {str(error)}"]
return JsonResponse(
{
"errors": content