Error handling for natural language querying in visualization designer
Next iteration from Frontend - natural language querying in visuali... (#435259 - closed)
Problem to solve
When there are errors while using natural language querying in the visualization designer there is no way for the user to know what has happened or what they can do to resolve it. There are situations where the UI will get "stuck" in a loading state forever.
Proposed solution
Add proper error handling for bad AI generated queries. Including:
- network errors / empty responses
- malformed queries (not part of this issue, see: #440742 (closed))
- valid shaped queries which fail to execute on Cube
Design
Implementation plan
-
Add error state to ai_cube_query_generator.vue
-
When state has error value, show error validation text to inform user their query generation failed. Also put textarea into invalid state
- we don't get specific user-friendly errors from the backend so will just display a fairly generic error message as per the mockup
- Handle various places errors occur:
- subscribe to ai completion response
- ai completion response error callback
- ai completion 200 response with errors in body
- response body does not contain valid JSON
-
Log the error to Sentry
-
Add validation message when "Generate with Duo" is clicked without a prompt being entered
-
Add tests
Edited by Elwyn Benson