mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat: return security errors in the SIP-40 format (#9796)
This commit is contained in:
@@ -14,10 +14,12 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from typing import Optional
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from flask_babel import gettext as _
|
||||
|
||||
from superset.errors import SupersetError
|
||||
|
||||
|
||||
class SupersetException(Exception):
|
||||
status = 500
|
||||
@@ -41,9 +43,12 @@ class SupersetTimeoutException(SupersetException):
|
||||
class SupersetSecurityException(SupersetException):
|
||||
status = 401
|
||||
|
||||
def __init__(self, msg: str, link: Optional[str] = None) -> None:
|
||||
super(SupersetSecurityException, self).__init__(msg)
|
||||
self.link = link
|
||||
def __init__(
|
||||
self, error: SupersetError, payload: Optional[Dict[str, Any]] = None
|
||||
) -> None:
|
||||
super(SupersetSecurityException, self).__init__(error.message)
|
||||
self.error = error
|
||||
self.payload = payload
|
||||
|
||||
|
||||
class NoDataException(SupersetException):
|
||||
|
||||
Reference in New Issue
Block a user