aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/language/exceptions.py
blob: 84ad3c02e2a4971065a1d07b20cc3c72608ae1d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)