(rewritten):
- REST functions need to return errors in their response, usually with a status code
- functions that are called directly have to return the error if it is encountered and must not continues
- functions that are called by other functions must return a map with the error, ideally with an HTTP response code and a more detailed description.
- internal error codes should match
wdbErr:rest0000
- when views are concerned, we only throw errors upwards and only catch them in
view.xql
If we catch them early and create an output, re-catching and re-processing may happen and thus the error gets hidden and users will only receive an incomplete HTML with no way of really knowing what went wrong.
(rewritten):
wdbErr:rest0000view.xqlIf we catch them early and create an output, re-catching and re-processing may happen and thus the error gets hidden and users will only receive an incomplete HTML with no way of really knowing what went wrong.