ChartDataRestApi.data() isn't decorated with @handle_api_exception, so a
correctly-classified QueryObjectValidationError (e.g. from a virtual
dataset's Jinja template indexing into an empty filter_values() list)
propagates uncaught to Flask's global catch-all, which always logs at
ERROR and returns HTTP 500 regardless of the exception's real status.
Add @app.errorhandler(SupersetException) mirroring the existing
handle_api_exception pattern: log level and HTTP status now follow
ex.status via get_logger_from_status, instead of being hardcoded to
ERROR/500. Subclasses with their own specific handler (SupersetErrorException,
SupersetErrorsException, CommandException) are unaffected by Flask's MRO
dispatch. 500-status SupersetException subclasses keep logging at ERROR.
Fixes SUPERSET-PYTHON-12EZ
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>