justinpark commented on code in PR #25669:
URL: https://github.com/apache/superset/pull/25669#discussion_r1367332814
##########
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:
@eschutho I hope to overwrite the error message when
SupersetSecurityException is thrown because it specifies the error description.
`Dataset could not be created.` (DatasetCreateFailedError) vs `Only "SELECT"
statements are allowed` (SupersetSecurityException)
--
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]