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
175 stars 117 forks source link

process exceptions are returned with http code 200 #559

Closed cehbrecht closed 3 years ago

cehbrecht commented 3 years ago

Description

If an exception occurs in the execution of a process the wps exception report will be returned with http code 200: https://github.com/geopython/pywps/blob/20e1e254a3f7914e555fa89f363d1f6eb5f3895c/pywps/app/Process.py#L265

Is this indented or should we raise a NoApplicableCode exception with http code 400? https://github.com/geopython/pywps/blob/20e1e254a3f7914e555fa89f363d1f6eb5f3895c/pywps/exceptions.py#L28

Environment

Steps to Reproduce

Raise an exception in the process, example: https://github.com/bird-house/emu/blob/master/emu/processes/wps_error.py

Additional Information

See PRs working on exceptions: #358, #406

cehbrecht commented 3 years ago

@jachym @gschwind @tomkralidis @ldesousa thoughts on this?

cehbrecht commented 3 years ago

There are two kinds of exceptions. The InvalidParameterValue etc exceptions are raised before the job is started: https://github.com/geopython/pywps/blob/master/pywps/exceptions.py

These already return a HTTP code 400.

In our case the exception is raised after the job has started ... maybe in async mode. In this case we can only update the xml status document which is read via the nginx (or apache ...) file-service. I suppose in this case we don't have the chance to set the HTTP code. Right?

ping @huard @davidcaron

So, it might be an issue with the wps 1.0.0 protocol. This is probably different with wps 2.0.0 because the service has a GetStatus request.

cehbrecht commented 3 years ago

This will be fixed when move to the ogcapi rest-api.