-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.py
More file actions
37 lines (23 loc) · 825 Bytes
/
Copy patherror.py
File metadata and controls
37 lines (23 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: yhf
# @Date: 2015-04-20 18:18:45
# @Last Modified by: yhf
# @Last Modified time: 2015-04-21 16:32:59
class TemplateError(Exception):
pass
class TemplateContextError(TemplateError):
def __init__(self, context_var):
self.context_var = context_var
def __str__(self):
return "Cannot resolve '%s'." % self.context_var
class TemplateSyntaxError(TemplateError):
def __init__(self, error_syntax):
self.error_syntax = error_syntax
def __str__(self):
return "'%s' seems like invalid syntax." % self.error_syntax
class TemplateOperatorError(TemplateError):
def __init__(self, error_op):
self.error_op = error_op
def __str__(self):
return "'%s' is an invalid operator." % self.error_op