workflow_ocr
workflow_ocr copied to clipboard
[FEATURE] Improve error handling in config UI
Related issues
https://github.com/R0Wi-DEV/workflow_ocr/issues/215 https://github.com/R0Wi-DEV/workflow_ocr/issues/183
Description
If the user opens up the workflow config UI, we query some data in the background which represents the current config state (for example the installed OCR languages which we show later in a dropdown menu). There is currently not really an error handling in case any of the API endpoints returns a statuscode != 200.
To do
We should improve our ajax service classes in https://github.com/R0Wi-DEV/workflow_ocr/tree/be65cde83a867b15e86c6c9594da8fa877c33089/src/service to handle any error responses. Our server implementations will return something like this in case of an unhandled 500 server error:
{ "error": "<MESSAGE>" }
Implementation plan
- Inject a possibility to show UI notifications into our ajax service classes (something like
OC.Notification.showTemporarybut ideally non-static) - Implement error handling in case server sends a non-200 statuscode (show message in that case if possible, otherwise "unknown error...")
- Adjust tests