geopython / geopython/pywps

Status code 200 when error in execution handler

Open
#442 11 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
186
Forks
117
Avg merge
11d 20h
Merged PRs (30d)
1

Description

# Description

Hey,

I believe there's an issue with the status code. when the handler itself raises an error the Process.py catches it (lines below) sets the wps_request as failed (attached below) but then continues like no error occurred. As result the status code of the HTTP request is 200 and should be 500

https://github.com/geopython/pywps/blob/ec1d90f7424598a662f68c28e4de4452e2bdeaf3/pywps/app/Process.py#L232

I can think of 2 solutions:
* re-raise an NoApplicableCode at [Process.py#L232](https://github.com/geopython/pywps/blob/master/pywps/app/Process.py#L232)
* before the `return response` [(Service.py#L326)](https://github.com/geopython/pywps/blob/master/pywps/app/Service.py#326) check whether the response is failed one and if so raise an NoApplicableCode that will be catched at [Service.py#L335](https://github.com/geopython/pywps/blob/master/pywps/app/Service.py#L335)

What do you guys think? @cehbrecht @jachym

# Environment

- operating system: ubuntu 18
- Python version: 3.6
- PyWPS version: latest from github
- source/distribution: git clone
- web server: Flask

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.