Gracefully handle scheduling errors in the UI #426
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
"Simple" way to reproduce
Try to schedule a task with invalid output so the scheduling request fails. I did this by running an old translation task again (with "Try again") after having changed the provider so the language enum values had changed.
Issue
When the scheduling request fails
[Object, Object]because we try to display the message from the response with accessing the wrong attributesFix
When the scheduling request fails
Additional change: Catch the promise error (case 1.) on the upper level to prevent the error to reach the top and polute the browser log.
Question
Should we include the error message returned in the scheduling response in case of error in the toast message?
For now a static
Assistant error: Something went wrong when scheduling the taskis shown.I'm wondering because in the specific example I witnessed, the manager validation error is not really meant to be displayed to the user.