feat: update timeout error UX (#10274)

This commit is contained in:
Erik Ritter
2020-07-20 15:32:17 -07:00
committed by GitHub
parent d92cb66f60
commit 5fa4680447
29 changed files with 557 additions and 65 deletions

View File

@@ -79,6 +79,7 @@ from sqlalchemy.engine.reflection import Inspector
from sqlalchemy.sql.type_api import Variant
from sqlalchemy.types import TEXT, TypeDecorator
from superset.errors import ErrorLevel, SupersetErrorType
from superset.exceptions import (
CertificateException,
SupersetException,
@@ -617,7 +618,12 @@ class timeout: # pylint: disable=invalid-name
self, signum: int, frame: Any
) -> None:
logger.error("Process timed out")
raise SupersetTimeoutException(self.error_message)
raise SupersetTimeoutException(
error_type=SupersetErrorType.BACKEND_TIMEOUT_ERROR,
message=self.error_message,
level=ErrorLevel.ERROR,
extra={"timeout": self.seconds},
)
def __enter__(self) -> None:
try: