Package com.yahoo.io

Class FatalErrorHandler


  • public class FatalErrorHandler
    extends Object
    What to do if a fatal condition happens in an IO component.

    TODO: We need to re-think this design a bit. First off, we probably need to make the interface an abstract class or a pure interface type. Second we provide a few default implementations which are named after what policy they implement -- like SystemExitOnError etc. Also, runnables that have fatal error handling capability should probably implement a standard interface for get/set etc. Also, we should encourage application authors to provide their own, application specific error handlers rather than relying on the default.

    Author:
    Steinar Knutsen
    • Field Detail

      • log

        protected static final Logger log
    • Constructor Detail

      • FatalErrorHandler

        public FatalErrorHandler()
    • Method Detail

      • handle

        public void handle​(Throwable t,
                           Object context)
        Do something reasonable when a an Error occurs. Override this to change behavior. Default behavior is to log the error, then exit.
        Parameters:
        t - The Throwable causing the handler to be activated.
        context - The object calling the handler.