Olivier Dutrieux
Olivier Dutrieux

Reputation: 1

RestartResponseAtInterceptPageException http 500

When a exception is throw, I intercept the exception to display in webpage (ExceptionPage.class) like this :

WicketApplication.class :

getRequestCycleListeners().add(
    new IRequestCycleListener() {
       @Override
       public IRequestHandler onException(RequestCycle cycle, Exception ex) {
          return new RenderPageRequestHandler(new PageProvider(new ExceptionPage(ex)));
       }
    }
);

But my ExceptionPage.class have on constructor Session.get().getClientInfo() :

public ExceptionPage(Throwable throwable) {
   super(new Model<>(throwable));
   Session.get().getClientInfo(); // to retrieve information of client.
}

The first time an exception is throw, I get http 500 (my ExceptionPage is not display)

image http 500

But after I refresh the page, ExceptionPage is display.

The problem seems to be Session.get().getClientInfo() in the ExceptionPage constructor.

Upvotes: 0

Views: 21

Answers (0)

Related Questions