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


##########
superset/datasets/commands/create.py:
##########
@@ -49,10 +50,14 @@ def run(self) -> Model:
             # Updates columns and metrics from the dataset
             dataset.fetch_metadata(commit=False)
             db.session.commit()
-        except (SQLAlchemyError, DAOCreateFailedError) as ex:
+        except (SQLAlchemyError, DAOCreateFailedError, 
SupersetSecurityException) as ex:
             logger.warning(ex, exc_info=True)
             db.session.rollback()
-            raise DatasetCreateFailedError() from ex
+            raise DatasetCreateFailedError(
+                *{"message": str(ex)}
+                if isinstance(ex, SupersetSecurityException)

Review Comment:
   @justinpark I think you'll get the same behavior just by catching the 
SupersetSecurityException and let DatasetCreateFailedError raise as it is now. 
I don't believe you'll need to change the error message there in line 55. 
Unless I'm missing something else?



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