aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/language/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'libpathod/language/exceptions.py')
-rw-r--r--libpathod/language/exceptions.py21
1 files changed, 21 insertions, 0 deletions
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)