Skip to content

Commit

Permalink
fix: dataset import error message (apache#23025)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar authored and PawankumarES committed Feb 13, 2023
1 parent 2e9a901 commit 7127bc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions superset/commands/importers/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def run(self) -> None:
try:
self._import(db.session, self._configs, self.overwrite)
db.session.commit()
except CommandException as ex:
db.session.rollback()
raise ex
except Exception as ex:
db.session.rollback()
raise self.import_error() from ex
Expand Down
2 changes: 1 addition & 1 deletion superset/datasets/commands/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,5 @@ class DatasetDuplicateFailedError(CreateFailedError):
message = _("Dataset could not be duplicated.")


class DatasetForbiddenDataURI(ForbiddenError):
class DatasetForbiddenDataURI(ImportFailedError):
message = _("Data URI is not allowed.")

0 comments on commit 7127bc1

Please sign in to comment.