Skip to content

Commit

Permalink
minor code update in NoAccessExceptionHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
greenlaw110 committed Jan 31, 2017
1 parent f4ead63 commit c965917
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/java/act/aaa/NoAccessExceptionHandler.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
package act.aaa;

import act.Act;
import act.ActComponent;
import act.app.ActionContext;
import act.handler.builtin.controller.ActionHandlerInvoker;
import act.handler.builtin.controller.ExceptionInterceptor;
import act.view.ActForbidden;
import org.osgl.aaa.NoAccessException;
import org.osgl.mvc.result.Forbidden;
import org.osgl.mvc.result.Result;

public class NoAccessExceptionHandler extends ExceptionInterceptor {

private final boolean isDev;

@SuppressWarnings("unchecked")
public NoAccessExceptionHandler() {
super(0, NoAccessException.class);
isDev = Act.isDev();
}

@Override
Expand All @@ -37,6 +31,6 @@ public boolean sessionFree() {

@Override
protected Result internalHandle(Exception e, ActionContext actionContext) {
return isDev ? new ActForbidden(e) : Forbidden.INSTANCE;
return ActForbidden.create(e);
}
}

0 comments on commit c965917

Please sign in to comment.