Package com.yahoo.io

Class FatalErrorHandler

java.lang.Object
com.yahoo.io.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 Details

    • log

      protected static final Logger log
  • Constructor Details

    • FatalErrorHandler

      public FatalErrorHandler()
  • Method Details

    • 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.