Class GlideException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.bumptech.glide.load.engine.GlideException
All Implemented Interfaces:
Serializable

public final class GlideException extends Exception
An exception with zero or more causes indicating why a load in Glide failed.
See Also:
  • Constructor Details

    • GlideException

      public GlideException(String message)
    • GlideException

      public GlideException(String detailMessage, Throwable cause)
    • GlideException

      public GlideException(String detailMessage, List<Throwable> causes)
  • Method Details

    • setOrigin

      public 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.

    • getOrigin

      @Nullable public Exception getOrigin()
      Returns an Exception with a stack trace that includes where the request originated (if previously set via setOrigin(Exception))

      This is an experimental API that may be removed in the future.

    • fillInStackTrace

      public Throwable fillInStackTrace()
      Overrides:
      fillInStackTrace in class Throwable
    • getCauses

      public List<Throwable> getCauses()
      Returns a list of causes that are immediate children of this exception.

      Causes may or may not be GlideExceptions. Causes may also not be root causes, and in turn my have been caused by other failures.

      See Also:
    • getRootCauses

      public 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 have failed due to an error that can be retried. Keep in mind that because Glide may attempt to load a given model using multiple different pathways, there may be multiple related or unrelated reasons for a load to fail.

    • logRootCauses

      public void logRootCauses(String tag)
      Logs all root causes using the given tag.

      Each root cause is logged separately to avoid throttling. printStackTrace() will provide a more succinct overview of why the exception occurred, although it does not include complete stack traces.

    • printStackTrace

      public void printStackTrace()
      Overrides:
      printStackTrace in class Throwable
    • printStackTrace

      public void printStackTrace(PrintStream err)
      Overrides:
      printStackTrace in class Throwable
    • printStackTrace

      public void printStackTrace(PrintWriter err)
      Overrides:
      printStackTrace in class Throwable
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable