You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/07/14 09:39:58 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #10300: fix(chart-data-api): improve chart data endpoint errors

villebro commented on a change in pull request #10300:
URL: https://github.com/apache/incubator-superset/pull/10300#discussion_r454232515



##########
File path: superset/charts/api.py
##########
@@ -465,13 +465,16 @@ def data(self) -> Response:
             return self.response_400(message="Request is incorrect")
         except ValidationError as error:
             return self.response_400(
-                _("Request is incorrect: %(error)s", error=error.messages)
+                message=_("Request is incorrect: %(error)s", error=error.messages)
             )
         try:
             query_context.raise_for_access()
         except SupersetSecurityException:
             return self.response_401()
         payload = query_context.get_payload()
+        for query in payload:
+            if query["error"]:
+                return self.response_400(message=f"Error: {query['error']}")

Review comment:
       That's a great idea 👍  To unblock `0.37` I'll merge this as-is, but will improve exception handling after we ship the release. 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org