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



##########
File path: superset/errors.py
##########
@@ -46,6 +47,23 @@ class SupersetErrorType(str, Enum):
     DATASOURCE_SECURITY_ACCESS_ERROR = "DATASOURCE_SECURITY_ACCESS_ERROR"
     MISSING_OWNERSHIP_ERROR = "MISSING_OWNERSHIP_ERROR"
 
+    # Other errors
+    BACKEND_TIMEOUT_ERROR = "BACKEND_TIMEOUT_ERROR"
+
+
+ERROR_TYPES_TO_ERROR_CODES_MAPPING = {
+    SupersetErrorType.BACKEND_TIMEOUT_ERROR: [
+        {
+            "code": 1000,
+            "message": _("Error 1000 - The datasource is too large to query."),
+        },
+        {
+            "code": 1001,
+            "message": _("Error 1001 - The database is under an unusual 
load."),
+        },
+    ]
+}

Review comment:
       I think we might need separate entities for exception catching and error 
messaging. One example is for async queries in sql lab. We would catch an 
exception from the query failing, but then only want to write a subset of 
attributes to the query table for returning to the client later. Then when the 
client polls for query status, we're returning an error payload within that 
request, but no exception is occuring. They seem like 2 different entities to 
me, and I'm not sure how much is improved by having a complex inheritance tree 
consisting of both native Python Exceptions and UI specific payload classes




----------------------------------------------------------------
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