From 485ebe9fb14a674ae6a850bd036cc33a1290d992 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Tue, 29 Jan 2019 13:41:46 +0000 Subject: [PATCH] Added string representation of LocError --- openflexure_microscope/exceptions.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openflexure_microscope/exceptions.py b/openflexure_microscope/exceptions.py index 73db926f..ee526ae4 100644 --- a/openflexure_microscope/exceptions.py +++ b/openflexure_microscope/exceptions.py @@ -15,6 +15,11 @@ class LockError(ThreadError): self.message = LockError.ERROR_CODES[code] else: self.message = "Unknown error." - print("{}: {}".format(self.code, self.message)) + + self.string = "{}: {}".format(self.code, self.message) + print(self.string) - ThreadError.__init__(self) \ No newline at end of file + ThreadError.__init__(self) + + def __str__(self): + return self.string \ No newline at end of file