Add error handling for visualization designer natural language querying
What does this MR do and why?
Adds error handling for the visualization designer natural language querying flow.
- form validation, when user click "generate" without entering a prompt
- generate CubeJs mutation failure
- aiCompletionResponse subscription failure
- aiCompletionResponse subscription response body containing errors
- receive malformed JSON query from backend
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Before | After |
---|---|
(no feedback) | (form validation) |
(stuck loading forever) | (request error, shared by all cases) |
How to set up and validate locally
Apply setup steps for backend MR this one depends on:
- Enable AI features locally: https://docs.gitlab.com/ee/development/ai_features/#test-ai-features-locally
- Make sure you've enabled Vertex access and configured it with your GDK. This action does not use Anthropic's API, only Vertex.
- Enable the
:generate_cube_query
flag locally. NEW
Then:
- Follow these instructions to setup Product Analytics in GDK.
- Onboard
Product Analytics
by setting up the feature at Project > Analytics > Analytics dashboards. - Visit the visualization designer at Project > Analytics > Analytics dashboards > Visualization designer.
- Click Generate with no prompt to trigger validation
- Enter a prompt, disable network in browser devtools to simulate an error, then click Generate
Related to #435785 (closed)
Edited by Elwyn Benson