Class ExceptionHandlers


  • public class ExceptionHandlers
    extends java.lang.Object
    Provides some standard implementations of various exception actions. This class is not instantiable.
    • Field Detail

      • log

        private static final org.slf4j.Logger log
    • Constructor Detail

      • ExceptionHandlers

        private ExceptionHandlers()
    • Method Detail

      • loggingExceptionHandler

        public static ExceptionHandler loggingExceptionHandler​(org.slf4j.Logger logger)
        Retrieves an ExceptionHandler which will log exceptions passed in.
        Parameters:
        logger - the Logger to which exceptions will be logged; if it is null, a default Logger will be used. The default logger is the logger for the ExceptionHandlers class, but may change in future.
        Returns:
        an ExceptionHandler which will log (at WARN level) exceptions passed in
      • chain

        public static ExceptionHandler chain​(ExceptionHandler... handlers)
        Chain a series of ExceptionHandlers together to be executed subsequently; if one throws an exception, subsequent handlers will not be executed.
        Parameters:
        handlers - the chain of handlers to chain
        Returns:
        an ExceptionHandler composing the supplied handlers
      • logger

        static org.slf4j.Logger logger()