This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch hugh/dataset-404
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 8811f2e3643772ed5f2bf11b941f686023e7d44e
Author: hughhhh <[email protected]>
AuthorDate: Sun Apr 11 20:48:37 2021 -0400

    setup exception
---
 superset/views/base.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/superset/views/base.py b/superset/views/base.py
index 140fa55..fbd1be7 100644
--- a/superset/views/base.py
+++ b/superset/views/base.py
@@ -167,6 +167,8 @@ def api(f: Callable[..., FlaskResponse]) -> Callable[..., 
FlaskResponse]:
     def wraps(self: "BaseSupersetView", *args: Any, **kwargs: Any) -> 
FlaskResponse:
         try:
             return f(self, *args, **kwargs)
+        except SupersetException as ex:
+            return json_error_response(get_error_msg(), status=ex.status)
         except NoAuthorizationError as ex:  # pylint: disable=broad-except
             logger.warning(ex)
             return json_error_response(get_error_msg(), status=401)

Reply via email to