forked from spullara/mustache.java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMustacheException.java
More file actions
53 lines (42 loc) · 1.17 KB
/
MustacheException.java
File metadata and controls
53 lines (42 loc) · 1.17 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.github.mustachejava;
/**
* Generally there is nothing you can do if it fails.
*/
public class MustacheException extends RuntimeException {
private TemplateContext context;
public MustacheException() {
super();
}
public MustacheException(String message) {
super(message);
}
public MustacheException(String message, Throwable throwable) {
super(message, throwable);
}
public MustacheException(String message, Throwable throwable, TemplateContext context) {
super(message, throwable);
this.context = context;
}
public MustacheException(Throwable throwable) {
super(throwable);
}
public MustacheException(String message, TemplateContext context) {
super(message);
this.context = context;
}
public MustacheException(Exception e, TemplateContext context) {
super(e);
this.context = context;
}
@Override
public String getMessage() {
return context == null ? super.getMessage() : super.getMessage() + " @" + context;
}
public void setContext(TemplateContext context) {
if (this.context == null)
this.context = context;
}
public TemplateContext getContext() {
return context;
}
}