From 5b1640b25d45c5b5b8bcb742b03c5605ef773a29 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Wed, 10 Feb 2016 18:54:15 +0100 Subject: [PATCH] Refactor errors --- patacrep/errors.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/patacrep/errors.py b/patacrep/errors.py index e32cd0e1..746656ec 100644 --- a/patacrep/errors.py +++ b/patacrep/errors.py @@ -9,6 +9,9 @@ class SongbookError(Exception): super().__init__() self.message = message + def __str__(self): + return self.message + class SchemaError(SongbookError): """Error on the songbook schema""" @@ -48,13 +51,7 @@ class ExecutableNotFound(SongbookError): class StepError(SongbookError): """Error during execution of one compilation step.""" - - def __init__(self, message): - super().__init__() - self.message = message - - def __str__(self): - return self.message + pass class LatexCompilationError(StepError): """Error during LaTeX compilation.""" @@ -101,13 +98,7 @@ class UnknownStep(StepError): class ParsingError(SongbookError): """Parsing error.""" - - def __init__(self, message): - super().__init__(self) - self.message = message - - def __str__(self): - return self.message + pass class SharedError(SongbookError): """Error that is meant to be shared to third party tools using patacrep."""