Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * JBoss, Home of Professional Open Source.
  * Copyright 2014 Red Hat, Inc., and individual contributors
  * as indicated by the @author tags.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
package io.undertow.servlet.api;
An exception handler allows you to perform custom actions when an exception propagates out of the servlet handler chain. The default handler will simply log the exception, however it is possible to write custom handlers to handle the error however you want. A common use for this would be to change the log format for exceptions, or possibly suppress the logging for certain exceptions types.

Implementations of this interface may also choose to suppress error page handler, and handle error page generation internally by returning true

Stuart Douglas
public interface ExceptionHandler {

Handles an exception. If this method returns true then the request/response cycle is considered to be finished, and no further action will take place, if this returns false then standard error page redirect will take place. The default implementation of this simply logs the exception and returns false, allowing error page and async context error handling to proceed as normal.

exchange The exchange
request The request
response The response
throwable The exception
<core>true</core> true if the error was handled by this method
    boolean handleThrowable(final HttpServerExchange exchangeServletRequest requestServletResponse responseThrowable throwable);
New to GrepCode? Check out our FAQ X