From 726d4c42dde92c67131ee0311e7f965dd2ea13ad Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Sat, 4 Apr 2020 14:48:48 +0100 Subject: Fix the calledprocesserror by not inheriting Turns out this never actually worked as intended. --- paper2remarkable/exceptions.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/paper2remarkable/exceptions.py b/paper2remarkable/exceptions.py index a608bcc..66a329f 100644 --- a/paper2remarkable/exceptions.py +++ b/paper2remarkable/exceptions.py @@ -90,16 +90,13 @@ class RemarkableError(Error): return msg -class _CalledProcessError(CalledProcessError): - """Exception raised when subprocesses fail. +class _CalledProcessError(Error): + """Exception raised when subprocesses fail. """ - We subclass the CalledProcessError so we can add our custom error message. - """ - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) + def __init__(self, message): + self.message = message def __str__(self): - parent = super().__str__() - msg = parent + GH_MSG + msg = "ERROR: {message}".format(message=self.message) + msg += GH_MSG return msg -- cgit v1.2.3