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