Handle shape(...) exceptions

This commit is contained in:
Francesco Frassinelli 2022-02-18 10:38:31 +01:00
parent 494ab539fd
commit df3af62cfa
1 changed files with 2 additions and 2 deletions

View File

@ -135,8 +135,8 @@ class SpatialMetadata(p.SingletonPlugin):
try:
save_package_extent(package.id,geometry)
except ValueError as e:
error_dict = {'spatial':[u'Error creating geometry: %s' % six.text_type(e)]}
except AttributeError as e:
error_dict = {'spatial':[u'Error creating geometry: invalid GeoJSON']}
raise tk.ValidationError(error_dict, error_summary=package_error_summary(error_dict))
except Exception as e:
if bool(os.getenv('DEBUG')):