Skip to content

Commit

Permalink
Fixing error reporting in batch registration.
Browse files Browse the repository at this point in the history
  • Loading branch information
constantinius committed Jan 12, 2015
1 parent 2109301 commit 12b8145
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,22 @@ def handle(self, *args, **kwargs):
def handle_file(self, reader, kwargs):
sid = None
on_error = kwargs["on_error"]
traceback = kwargs["traceback"]
verbosity = kwargs["verbosity"]

for row in reader:
params = self._translate_params(row)
if on_error != "rollback":
sid = transaction.savepoint()
try:
call_command("eoxs_dataset_register",
**params
traceback=traceback, verbosity=verbosity, **params
)
if sid:
transaction.savepoint_commit(sid)
except:
except Exception, e:
self.print_err(
"Error occurred: '%s'" % e
)
transaction.savepoint_rollback(sid)
if on_error == "ignore":
Expand Down

0 comments on commit 12b8145

Please sign in to comment.