eschutho commented on code in PR #20491:
URL: https://github.com/apache/superset/pull/20491#discussion_r906277265


##########
superset/sqllab/command.py:
##########
@@ -110,7 +114,13 @@ def run(  # pylint: 
disable=too-many-statements,useless-suppression
                 "status": status,
                 "payload": 
self._execution_context_convertor.serialize_payload(),
             }
-        except (SqlLabException, SupersetErrorsException) as ex:
+        except SupersetErrorsException as ex:
+            if all(ex.error_type == SupersetErrorType.SYNTAX_ERROR for ex in 
ex.errors):
+                ex.status = 422

Review Comment:
   This is great @diegomedina248. Thank you! Can we raise a new error instead 
of the original one? We may have to create a new syntax error class with a 422 
status. 



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