-
- All Implemented Interfaces:
-
java.io.Serializable
public final class ImageModuleException extends Exception
An exception with zero or more causes indicating why a load in ImageModule failed.
-
-
Constructor Summary
Constructors Constructor Description ImageModuleException(String message)ImageModuleException(String detailMessage, Throwable cause)ImageModuleException(String detailMessage, List<Throwable> causes)
-
Method Summary
Modifier and Type Method Description List<Throwable>getCauses()Returns a list of causes that are immediate children of this exception. voidsetOrigin(@Nullable() Exception exception)Sets a stack trace that includes where the request originated. ExceptiongetOrigin()Returns an Exception with a stack trace that includes where the request originated (ifpreviously set via setOrigin)This is an experimental API that may be removed in the future. ThrowablefillInStackTrace()List<Throwable>getRootCauses()Returns the list of root causes that are the leaf nodes of all children of this exception. voidlogRootCauses(String tag)Logs all root causes using the given tag. voidprintStackTrace()voidprintStackTrace(PrintStream err)voidprintStackTrace(PrintWriter err)StringgetMessage()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getCauses
List<Throwable> getCauses()
Returns a list of causes that are immediate children of this exception.
Causes may or may not be ImageModuleExceptions. Causes may also not be rootcauses, and in turn my have been caused by other failures.
-
setOrigin
void setOrigin(@Nullable() Exception exception)
Sets a stack trace that includes where the request originated.
This is an experimental API that may be removed in the future.
-
fillInStackTrace
Throwable fillInStackTrace()
-
getRootCauses
List<Throwable> getRootCauses()
Returns the list of root causes that are the leaf nodes of all children of this exception.
Use this method to do things like look for http exceptions that indicate the load may havefailed due to an error that can be retried. Keep in mind that because ImageModule may attempt to loada given model using multiple different pathways, there may be multiple related or unrelatedreasons for a load to fail.
-
logRootCauses
void logRootCauses(String tag)
Logs all root causes using the given tag.
Each root cause is logged separately to avoid throttling. printStackTrace willprovide a more succinct overview of why the exception occurred, although it does not includecomplete stack traces.
-
printStackTrace
void printStackTrace()
-
printStackTrace
void printStackTrace(PrintStream err)
-
printStackTrace
void printStackTrace(PrintWriter err)
-
getMessage
String getMessage()
-
-
-
-