geopython / pywps

PyWPS is an implementation of the Web Processing Service standard from the Open Geospatial Consortium. PyWPS is written in Python.
https://pywps.org
MIT License
178 stars 117 forks source link

WPSRequest.json() better error handling #622

Closed idanmiara closed 3 years ago

idanmiara commented 3 years ago

Overview

pywps/app/WPSRequest.py - gaurd WPSRequest.json() with try...except to better handle some inputs. especially inputs with "complex" extra fields, which otherwise would raise 500 error. If someone wants to pass a complex input parameter:

    "extent": {
        "type": "bbox",
        "bbox": [32, 34.7, 32.1, 34.8]
    }

As there are no remarks in JSON, I normally add an underscore to the parameter name if I want it to be ignored. if "_extent" is not a parameter for the request then without this fix error 500 would be returned.

Related Issue / Discussion

Additional Information

Contribution Agreement

(as per https://github.com/geopython/pywps/blob/master/CONTRIBUTING.rst#contributions-and-licensing)

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 0.0% when pulling f09f4699136a330a00946dfbb3bc85a4c08639c7 on talos-gis:error_handling2 into 77aa30a2d5e72868099308301a3e1dbfd8fbcedc on geopython:main.