mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
feat: add more SIP-40 errors to SQL Lab (#15436)
This commit is contained in:
@@ -43,9 +43,11 @@ class SupersetException(Exception):
|
||||
class SupersetErrorException(SupersetException):
|
||||
"""Exceptions with a single SupersetErrorType associated with them"""
|
||||
|
||||
def __init__(self, error: SupersetError) -> None:
|
||||
def __init__(self, error: SupersetError, status: Optional[int] = None) -> None:
|
||||
super().__init__(error.message)
|
||||
self.error = error
|
||||
if status is not None:
|
||||
self.status = status
|
||||
|
||||
|
||||
class SupersetGenericErrorException(SupersetErrorException):
|
||||
@@ -81,9 +83,13 @@ class SupersetErrorFromParamsException(SupersetErrorException):
|
||||
class SupersetErrorsException(SupersetException):
|
||||
"""Exceptions with multiple SupersetErrorType associated with them"""
|
||||
|
||||
def __init__(self, errors: List[SupersetError]) -> None:
|
||||
def __init__(
|
||||
self, errors: List[SupersetError], status: Optional[int] = None
|
||||
) -> None:
|
||||
super().__init__(str(errors))
|
||||
self.errors = errors
|
||||
if status is not None:
|
||||
self.status = status
|
||||
|
||||
|
||||
class SupersetTimeoutException(SupersetErrorFromParamsException):
|
||||
|
||||
Reference in New Issue
Block a user