1 # -*- coding: utf-8 -*-
8 :copyright: 2008 by Armin Ronacher.
9 :license: BSD, see LICENSE for more details.
13 class TemplateError(Exception):
14 """Baseclass for all template errors."""
17 class UndefinedError(TemplateError):
18 """Raised if a template tries to operate on :class:`Undefined`."""
21 class TemplateNotFound(IOError, LookupError, TemplateError):
22 """Raised if a template does not exist."""
24 def __init__(self, name):
25 IOError.__init__(self, name)
29 class TemplateSyntaxError(TemplateError):
30 """Raised to tell the user that there is a problem with the template."""
32 def __init__(self, message, lineno, name):
33 TemplateError.__init__(self, '%s (line %s)' % (message, lineno))
34 self.message = message
39 class TemplateAssertionError(TemplateSyntaxError):
40 """Like a template syntax error, but covers cases where something in the
41 template caused an error at compile time that wasn't necessarily caused
46 class TemplateRuntimeError(TemplateError):
47 """A runtime error."""
50 class FilterArgumentError(Exception):
51 """This error is raised if a filter was called with inappropriate