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.
SUMMARY
When template params are malformed in sql lab, we return an error from the backend that doesn't include an error level. This caused the frontend to crash
I think this was likely caused by #16917 or #16852, but i don't have enough context on the backend right now to resolve it there. I figure we should also harden the frontend to handle this case, so i added the check there. @ofekisr, could you follow up your PR and ensure that all errors you pass from the backend contain an ErrorLevel? We have helper functions to construct those errors, so it shouldn't be too difficult
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
CI, write a query with a malformed jinja template param and see the error properly
ADDITIONAL INFORMATION
to: @rusackas @pkdotson @graceguo-supercat @michael-s-molina