etr2460 commented on a change in pull request #10274:
URL:
https://github.com/apache/incubator-superset/pull/10274#discussion_r452551728
##########
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:
Hmm, possibly. I'm not super familiar with what the plan is for
exception handling on the Python side, but having the SupersetExceptions
automatically contain the error properties might make sense.
The reason I shied away from it originally was so that it was very clear
what attributes the clients need to render the errors and what parts are server
specific. But maybe that's not a big issue. Maybe @john-bodley has thoughts?
----------------------------------------------------------------
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]