Class CrashHandler
java.lang.Object
com.prineside.tdi2.utils.errorhandling.CrashHandler
Handles uncaught exceptions on threads and notifies ActionResolver about them
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidhandleThreadExceptions(Thread thread) Handle uncaught exceptions on a thread and exit the app if they occurstatic voidHandle uncaught exceptions on a thread but do not exit the appstatic booleanisThreadExceptionsHandled(Thread thread) Check if thread exceptions are handledstatic voidstatic voidstatic voidsetActionResolver(ActionResolver actionResolver) Set an ActionResolver which will be notified about a crash.
-
Constructor Details
-
CrashHandler
public CrashHandler()
-
-
Method Details
-
setActionResolver
Set an ActionResolver which will be notified about a crash. If threads were handled before ActionResolver is set, it will be notified about those threads too. Automatically handles exceptions on the thread this method is being called on.- Parameters:
actionResolver- a resolver on which the handleThreadExceptions() method will be called in case an unhandled exception occurs
-
isThreadExceptionsHandled
Check if thread exceptions are handled- Parameters:
thread- a thread to check- Returns:
- true if any of the handleThreadExceptions...() methods were called for the specified thread
-
handleThreadExceptions
Handle uncaught exceptions on a thread and exit the app if they occur- Parameters:
thread- a thread to handle
-
handleThreadExceptionsForgiving
Handle uncaught exceptions on a thread but do not exit the app- Parameters:
thread- a thread to handle
-
report
-
report
-