Class OnErrorThrowable

  • All Implemented Interfaces:
    Serializable


    public final class OnErrorThrowable
    extends RuntimeException
    Represents a Throwable that an Observable might notify its subscribers of, but that then can be handled by an operator that is designed to recover from or react appropriately to such an error. You can recover more information from an OnErrorThrowable than is found in a typical Throwable, such as the item the Observable was trying to emit at the time the error was encountered.
    See Also:
    Serialized Form
    • Method Detail

      • getValue

        public Object getValue()
        Get the value associated with this OnErrorThrowable
        Returns:
        the value associated with this OnErrorThrowable (or null if there is none)
      • isValueNull

        public boolean isValueNull()
        Indicates whether or not there is a value associated with this OnErrorThrowable
        Returns:
        true if there is a value associated with this OnErrorThrowable, otherwise false
      • addValueAsLastCause

        public static Throwable addValueAsLastCause(Throwable e,
                                                    Object value)
        Adds the given item as the final cause of the given Throwable, wrapped in OnNextValue (which extends RuntimeException).
        Parameters:
        e - the Throwable to which you want to add a cause
        value - the item you want to add to e as the cause of the Throwable
        Returns:
        the same Throwable ( e) that was passed in, with value added to it as a cause