# 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:
@@ -407,7 +407,10 @@ class Geometry(BaseResource):
|
||||
"""
|
||||
output_geom = input_geom
|
||||
if not isinstance(input_geom, MultiPolygon):
|
||||
output_geom = MultiPolygon(input_geom, srid=DEFAULT_SRID_RLP)
|
||||
try:
|
||||
output_geom = MultiPolygon(input_geom, srid=DEFAULT_SRID_RLP)
|
||||
except TypeError as e:
|
||||
raise AssertionError(f"Only (Multi)Polygon allowed! Could not convert {input_geom.geom_type} to MultiPolygon")
|
||||
return output_geom
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -33,7 +33,7 @@ class KonovaExceptionReporter(ExceptionReporter):
|
||||
"""
|
||||
whitelist = [
|
||||
"is_email",
|
||||
"unicdoe_hint",
|
||||
"unicode_hint",
|
||||
"frames",
|
||||
"request",
|
||||
"user_str",
|
||||
|
||||
Reference in New Issue
Block a user