fix: dataset import error message (#23025)

This commit is contained in:
Daniel Vaz Gaspar 2023-02-07 18:21:32 -08:00 committed by GitHub
parent 98bf878d6e
commit 7bb9b810ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -67,6 +67,9 @@ class ImportModelsCommand(BaseCommand):
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

View File

@ -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.")