Skip to content

Commit

Permalink
Pass message instead of object representation
Browse files Browse the repository at this point in the history
Exceptions implement `.__str__` which can be used to be passed to the template error output. This prevents ugly string formatting like `u''`.
  • Loading branch information
jnns committed Mar 2, 2016
1 parent ab2c586 commit 979c0cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion import_export/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def import_data(self, dataset, dry_run=False, raise_errors=False,
except Exception as e:
logging.exception(e)
tb_info = traceback.format_exc()
result.base_errors.append(Error(repr(e), tb_info))
result.base_errors.append(Error(e, tb_info))
if raise_errors:
if use_transactions:
savepoint_rollback(sp1)
Expand Down

0 comments on commit 979c0cb

Please sign in to comment.