Skip to content

Commit b245cdc

Browse files
committed
fix issue with error pages
1 parent 95b1722 commit b245cdc

5 files changed

Lines changed: 17 additions & 5 deletions

File tree

src/main/java/act/view/SystemImplicitVariableProvider.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ public Object eval(ActionContext context) {
4141
return context;
4242
}
4343
},
44+
new ActionViewVarDef("_mailer", MailerContext.class) {
45+
@Override
46+
public Object eval(ActionContext context) {
47+
return null;
48+
}
49+
},
4450
new ActionViewVarDef("_session", H.Session.class) {
4551
@Override
4652
public Object eval(ActionContext context) {
@@ -74,6 +80,12 @@ public Object eval(MailerContext context) {
7480
return context;
7581
}
7682
},
83+
new MailerViewVarDef("_action", ActionContext.class) {
84+
@Override
85+
public Object eval(MailerContext context) {
86+
return null;
87+
}
88+
},
7789
new MailerViewVarDef("_from", InternetAddress.class) {
7890
@Override
7991
public Object eval(MailerContext context) {

src/main/resources/rythm/error/e403.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@args act.util.ActError _error
55
@{
66
act.app.SourceInfo sourceInfo = _error.sourceInfo();
7-
act.route.RouteInfo req = act.route.RouteInfo.of(_ctx);
7+
act.route.RouteInfo req = act.route.RouteInfo.of(_action);
88
List<String> stackTrace = _error.stackTrace();
99
}
1010

src/main/resources/rythm/error/e404.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737

3838
@import act.route.*
3939
@{
40-
List<RouteInfo> routes = _ctx.router().debug();
41-
act.route.RouteInfo req = RouteInfo.of(_ctx);
40+
List<RouteInfo> routes = _action.router().debug();
41+
act.route.RouteInfo req = RouteInfo.of(_action);
4242
}
4343

4444
@def tr(RouteInfo r, String parity) {

src/main/resources/rythm/error/e500.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@extends(errorPage, header: "500 Internal Error")
22

33
@{
4-
act.route.RouteInfo routeInfo = act.route.RouteInfo.of(_ctx);
4+
act.route.RouteInfo routeInfo = act.route.RouteInfo.of(_action);
55
}
66

77

src/main/resources/rythm/error/errorPage.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
if (_error instanceof act.view.RythmError) {
1919
templateSourceInfo = ((act.view.RythmError) actError).templateSourceInfo();
2020
}
21-
act.route.RouteInfo routeInfo = act.route.RouteInfo.of(_ctx);
21+
act.route.RouteInfo routeInfo = null != _action ? act.route.RouteInfo.of(_action) : null;
2222
List<String> stackTrace = actError.stackTrace();
2323
}
2424

0 commit comments

Comments
 (0)