- java.lang.Object
-
- io.github.interacto.error.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 Summary
Constructors Constructor Description ErrorCatcher()Creates the error catcher.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.reactivex.Observable<Throwable>getErrors()static ErrorCatchergetInstance()voidreportError(Exception exception)Gathers exceptions.static voidsetInstance(ErrorCatcher newInstance)Sets the single instance.
-
-
-
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.
-
-