Skip to content

Error handling: show alert in production mode? #1257

@MetRonnie

Description

@MetRonnie

Currently any uncaught errors are handled here by presenting the alert snackbar in development mode only:

errorCaptured (error, vm, info) {
if (process.env.NODE_ENV !== 'production') {
store.dispatch('setAlert', new AlertModel(error, 'error'))
}
}

If an uncaught error occurs in the production build, the only clues will be a console error that users won't see and some kind of broken functionality.

You can test this out by adding throw new Error('oops') to the top of

subscribe (componentOrView) {
and then opening the UI at the dashboard. No workflows will load and there is no obvious indication something went wrong.

In fact there is an e2e test that ensures an alert is presented for this very scenario which only works because the e2e tests build the UI in development mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFlag this as a question for the next Cylc project meeting.small

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions