ktmud commented on a change in pull request #10274:
URL: 
https://github.com/apache/incubator-superset/pull/10274#discussion_r452550828



##########
File path: superset/exceptions.py
##########
@@ -37,7 +37,19 @@ def exception(self) -> Optional[Exception]:
 
 
 class SupersetTimeoutException(SupersetException):
-    pass
+    status = 408
+
+    def __init__(
+        self,
+        error_type: SupersetErrorType,
+        message: str,
+        level: ErrorLevel,
+        extra: Optional[Dict[str, Any]],
+    ) -> None:
+        super(SupersetTimeoutException, self).__init__(message)
+        self.error = SupersetError(
+            error_type=error_type, message=message, level=level, extra=extra
+        )

Review comment:
       I'm wondering whether we can just extend the attributes of 
`SupersetError` directly on `SupersetException` and use a custom JSON encoder 
to serialize it. This way you remove a layer of abstraction and the need to map 
the arguments for any new errors your might add in the future,




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to