gabotorresruiz commented on code in PR #34803:
URL: https://github.com/apache/superset/pull/34803#discussion_r2310494314


##########
superset/datasets/api.py:
##########
@@ -1319,9 +1322,12 @@ def render_item_list(item_list: list[dict[str, Any]]) -> 
list[dict[str, Any]]:
 
             try:
                 data[new_key] = func(data[key])
-            except TemplateSyntaxError as ex:
-                raise SupersetTemplateException(
+            except (TemplateSyntaxError, SupersetSyntaxErrorException) as ex:
+                template_exception = SupersetTemplateException(
                     f"Unable to render expression from dataset {item_type}.",
-                ) from ex
+                )
+
+                template_exception.status = 400

Review Comment:
   Oh @betodealmeida! Now I see what you mean. Right now 
`SupersetTemplateException` raises a 500 error. Do you want me to make the 
change so `SupersetTemplateException` raises an error status 400 instead of 
500? Let me know



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

To unsubscribe, e-mail: [email protected]

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