From 9109b3cc8cca05f34d3ddee062cf7f8bc401af31 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 2 May 2015 16:17:00 +1200 Subject: Massive refactoring to split up language implementation. --- libpathod/language/exceptions.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libpathod/language/exceptions.py (limited to 'libpathod/language/exceptions.py') diff --git a/libpathod/language/exceptions.py b/libpathod/language/exceptions.py new file mode 100644 index 00000000..c9d0b2f0 --- /dev/null +++ b/libpathod/language/exceptions.py @@ -0,0 +1,21 @@ + +class RenderError(Exception): + pass + + +class FileAccessDenied(RenderError): + pass + + +class ParseException(Exception): + def __init__(self, msg, s, col): + Exception.__init__(self) + self.msg = msg + self.s = s + self.col = col + + def marked(self): + return "%s\n%s"%(self.s, " " * (self.col - 1) + "^") + + def __str__(self): + return "%s at char %s"%(self.msg, self.col) -- cgit v1.2.3