Class ErrorCatcher


  • public class ErrorCatcher
    extends Object
    The singleton ErrorCatcher collects errors. The ErrorCatcher sends the gathered exception to an ErrorNotifier (if one is defined).
    Author:
    Arnaud BLOUIN
    • Constructor Detail

      • ErrorCatcher

        public ErrorCatcher()
        Creates the error catcher.
    • Method Detail

      • getInstance

        public static ErrorCatcher getInstance()
        Returns:
        The single instance. Cannot be null.
      • setInstance

        public static void setInstance​(ErrorCatcher newInstance)
        Sets the single instance.
        Parameters:
        newInstance - The new single instance. Nothing done if null.
      • getErrors

        public io.reactivex.Observable<Throwable> getErrors()
        Returns:
        An observable stream of errors. Cannot be null.
      • reportError

        public void reportError​(Exception exception)
        Gathers exceptions. The notifier is then notified of the exceptions (if defined).
        Parameters:
        exception - The errors to gather.