public class AutopsyThread extends Thread
run()
so other classes can check the status of the thread and know why it crashed.Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
AutopsyThread()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
crashed()
Checks if the thread has crashed.
|
Throwable |
getError()
Gets the crashing error.
|
void |
onError(Throwable t)
Handles the uncaught error on thread crashing.
|
void |
setError(Throwable t)
Sets the error before exiting.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public boolean crashed()
public void setError(Throwable t)
t
- the crashing errorpublic void onError(Throwable t)
t
- the crashing errorCopyright © 2023. All Rights Reserved.