wps-toolbox issueshttps://git.scc.kit.edu/aw6481/wps-toolbox/-/issues2020-10-08T17:10:47+02:00https://git.scc.kit.edu/aw6481/wps-toolbox/-/issues/1Implement a custom Exeption Object2020-10-08T17:10:47+02:00aw6481Implement a custom Exeption ObjectWhile implementing the new metacatalog into wps_toolbox I make use of exception handling a lot to raise exceptions if user input was wrong and catch it all together with unexpected errors at once. Then the wps tool output just contains t...While implementing the new metacatalog into wps_toolbox I make use of exception handling a lot to raise exceptions if user input was wrong and catch it all together with unexpected errors at once. Then the wps tool output just contains the content of any error occured.
usually looks like:
```python
try:
res = api.some_func()
if res = 'unexpected':
raise Exception('User did something wrong')
except Exception as e:
wps_metadata['error_message'] = str(e)
```
Then this error message contains *our* messege to the user that e.g. a wrong input was specified or whatsoever, **and** any exception that the `api.some_func()` may have caused.
I was just wondering if we implement a Custom Error like `WPSMisbehaviorError(Exception):` to wps_toolbox that can be used instead. Then after execution, django could parse the error message, or pywps does that to see if we should present a nicely formatted error to the user, like 'That was wrong try like this' or if the exception was not custom to give a warning like: 'Something went wrong but it was not your fault: click this link to report' and give an issue link to github or something.
@fq3407 what do you think? Shall I do something like this as I am refactoring most functions anyway?aw6481aw6481