Tell analytics dashboard users when Cube returns a 400
Problem to solve
When the analytics dashboard requests panel data from CubeJS and it fails, we show a generic "Something went wrong".
In some cases, Cube returns an error message which would help the user understand there is a problem with their query. For example, if there is a typo on a dimension:
{"message":"'agentNameZZZ' not found for path 'TrackedEvents.agentNameZZZ'"}
I have noticed this a bit more often since using the Customer MVC: natural language querying in visu... (&12245) feature, since the model sometimes returns a valid shaped query but with invalid values in it.
To reproduce
- Create a valid custom visualization via the viz designer, and add it to a dashboard
- Modify the visualization yml, changing one of the measures / dimensions to an invalid value. E.g.
TrackedEvents.agentName
toTrackedEvents.agentNameZZZ
- Refresh the dashboard and notice the generic error message we show. Check the devtools network response for /load, and notice the specific message returned from Cube
Proposed solution
Extend the error handling in panel base to show a more specific Cube error when one is available. Display this error inside the existing error popover.
Implementation plan
- Update panels_base.vue to display
error.message
in the tooltip whenisCubeJsBadRequest
- Update tests
Edited by Elwyn Benson