cylc / cylc-uiserver

A Jupyter Server extension that serves the cylc-ui web application for monitoring and controlling Cylc workflows.
https://cylc.org
GNU General Public License v3.0
15 stars 18 forks source link

Send server errors to the UI #68

Open kinow opened 5 years ago

kinow commented 5 years ago

At the moment, when executing GraphQL queries, it is possible to happen exceptions in the backend that are not sent back to the UI.

This means that the user won't be aware of the issue unless a component/view behaves erratically.

See #65 for an example, where there is an exception in the UI Server, but the UI server is receiving an empty [] in the GraphQL query.

(I also need to double-check if it's not the UI who is try/catch'ing the exception in returning an empty array? Though I think it doesn't do that... will confirm it later)

kinow commented 5 years ago

In the REST world, the RFC 7807 "Problem Details for HTTP APIs" is a good solution for this. e.g. Zalando connexion supports it, and they have a guidelines for using the problem details https://opensource.zalando.com/restful-api-guidelines/#176

There might be either a way to use something similar in GraphQL (GraphQL provides error handling, though not sure if that's enough for the UI).