From 6366f4bd01a005fdf21e651dfefcc827d6083577 Mon Sep 17 00:00:00 2001 From: Olivier Mangin Date: Wed, 13 Jan 2016 15:28:13 -0500 Subject: [PATCH] Uses exception __string__, not __repr__ to carry message. --- pubs/repo.py | 2 +- pubs/uis.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pubs/repo.py b/pubs/repo.py index 6aac55a..e3df89e 100644 --- a/pubs/repo.py +++ b/pubs/repo.py @@ -20,7 +20,7 @@ class CiteKeyError(Exception): self.message = message self.citekey = citekey - def __repr__(self): + def __str__(self): return self.message or self.default_msg.format(self.citekey) diff --git a/pubs/uis.py b/pubs/uis.py index 1392050..f61feb3 100644 --- a/pubs/uis.py +++ b/pubs/uis.py @@ -87,7 +87,7 @@ class PrintUI(object): if self.debug: raise exc else: - self.error(exc) + self.error(exc.__string__()) self.exit()