Example usage for org.apache.wicket.request.http.handler ErrorCodeRequestHandler ErrorCodeRequestHandler

List of usage examples for org.apache.wicket.request.http.handler ErrorCodeRequestHandler ErrorCodeRequestHandler

Introduction

In this page you can find the example usage for org.apache.wicket.request.http.handler ErrorCodeRequestHandler ErrorCodeRequestHandler.

Prototype

public ErrorCodeRequestHandler(final int errorCode) 

Source Link

Document

Construct.

Usage

From source file:name.martingeisse.admin.application.wicket.ExceptionMapper.java

License:Open Source License

@Override
public IRequestHandler map(final Exception e) {
    ParameterUtil.ensureNotNull(e, "e");
    try {/* w w  w  .j  a v  a 2 s.c  o  m*/
        final IRequestHandler result = internalMap(e);
        if (result == null) {
            // super.map will log the exception
            return super.map(e);
        } else {
            // log the exception here
            logger.error("Unexpected error occurred", e);
            return result;
        }
    } catch (final RuntimeException e2) {
        logger.error("nested exception in ExceptionMapper: " + e2.getMessage(), e2);
        return new ErrorCodeRequestHandler(500);
    }
}