public class ExceptionHandlerRegistry<R> extends Object
Constructor and Description |
---|
ExceptionHandlerRegistry(com.google.common.collect.ImmutableList<ExceptionHandler<? extends Throwable,R>> handlers,
ExceptionHandler<Throwable,R> genericHandler) |
public ExceptionHandlerRegistry(com.google.common.collect.ImmutableList<ExceptionHandler<? extends Throwable,R>> handlers, ExceptionHandler<Throwable,R> genericHandler)
public R handleException(Throwable t)
t
- the exception to handleThis method tries to find a registered ExceptionHandler
that can process the
input Exception, and calls that handler to process the exception. If it cannot find one, it
will try to unwrap the exception by calling getCause() to get underlying exceptions. If all
the underlying causes are exhausted, or any loop is detected in the exception chain before
an exception is handled, the top level Throwable will be processed by the genericHandler.