Skip to content

Instantly share code, notes, and snippets.

@qmx
Created October 4, 2012 00:23
Show Gist options
  • Save qmx/3830761 to your computer and use it in GitHub Desktop.
Save qmx/3830761 to your computer and use it in GitHub Desktop.
// on ag-controller
public interface HttpStatusAwareException {
public int getStatus();
}
// on ag-controller, DefaultRouter:L~88
} catch (Exception e) {
if (e instanceof HttpStatusAwareException) {
response.setStatus(((HttpStatusAwareException)e).getStatus());
}
throw new ServletException(e);
}
// on ag-security
public class GetOuttaHereException extends RuntimeException implements HttpStatusAwareException {
....
}
// on ag-security, after the failed check
throw new GetOuttaHereException();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment