From 73d2ef5bbfed7b4ceb3adf45cf6853d4e7f3e6d4 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 16 Nov 2017 16:31:10 -0800 Subject: [PATCH] Change exception __str__ to be the type + message Because the repr is ugly --- etiquette/exceptions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etiquette/exceptions.py b/etiquette/exceptions.py index 204254a..4ffea87 100644 --- a/etiquette/exceptions.py +++ b/etiquette/exceptions.py @@ -27,6 +27,9 @@ class EtiquetteException(Exception, metaclass=ErrorTypeAdder): self.error_message = self.error_message.format(*args, **kwargs) self.args = (self.error_message, args, kwargs) + def __str__(self): + return self.error_type + '\n' + self.error_message + # NO SUCH class NoSuch(EtiquetteException):