mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix: refactor view error handling into a separate module (#29330)
This commit is contained in:
committed by
GitHub
parent
3d0665183c
commit
e749efcb97
@@ -123,13 +123,13 @@ from superset.utils import json
|
||||
from superset.utils.core import error_msg_from_exception, parse_js_uri_path_item
|
||||
from superset.utils.oauth2 import decode_oauth2_state
|
||||
from superset.utils.ssh_tunnel import mask_password_info
|
||||
from superset.views.base import json_errors_response
|
||||
from superset.views.base_api import (
|
||||
BaseSupersetModelRestApi,
|
||||
requires_form_data,
|
||||
requires_json,
|
||||
statsd_metrics,
|
||||
)
|
||||
from superset.views.error_handling import json_error_response
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -458,7 +458,7 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
except DatabaseConnectionFailedError as ex:
|
||||
return self.response_422(message=str(ex))
|
||||
except SupersetErrorsException as ex:
|
||||
return json_errors_response(errors=ex.errors, status=ex.status)
|
||||
return json_error_response(ex.errors, status=ex.status)
|
||||
except DatabaseCreateFailedError as ex:
|
||||
logger.error(
|
||||
"Error creating model %s: %s",
|
||||
|
||||
Reference in New Issue
Block a user