Package rx.exceptions

Class OnErrorThrowable.OnNextValue

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    OnErrorThrowable

    public static class OnErrorThrowable.OnNextValue
    extends java.lang.RuntimeException
    Represents an exception that was encountered while trying to emit an item from an Observable, and tries to preserve that item for future use and/or reporting.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID  
      private java.lang.Object value  
    • Constructor Summary

      Constructors 
      Constructor Description
      OnNextValue​(java.lang.Object value)
      Create an OnNextValue exception and include in its error message a string representation of the item that was intended to be emitted at the time the exception was handled.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getValue()
      Retrieve the item that the Observable was trying to emit at the time this exception occurred.
      (package private) static java.lang.String renderValue​(java.lang.Object value)
      Render the object if it is a basic type.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • value

        private final java.lang.Object value
    • Constructor Detail

      • OnNextValue

        public OnNextValue​(java.lang.Object value)
        Create an OnNextValue exception and include in its error message a string representation of the item that was intended to be emitted at the time the exception was handled.
        Parameters:
        value - the item that the Observable was trying to emit at the time of the exception
    • Method Detail

      • getValue

        public java.lang.Object getValue()
        Retrieve the item that the Observable was trying to emit at the time this exception occurred.
        Returns:
        the item that the Observable was trying to emit at the time of the exception
      • renderValue

        static java.lang.String renderValue​(java.lang.Object value)
        Render the object if it is a basic type. This avoids the library making potentially expensive or calls to toString() which may throw exceptions. If a specific behavior has been defined in the RxJavaErrorHandler plugin, some types may also have a specific rendering. Non-primitive types not managed by the plugin are rendered as the classname of the object.

        See PR #1401 and Issue #2468 for details.

        Parameters:
        value - the item that the Observable was trying to emit at the time of the exception
        Returns:
        a string version of the object if primitive or managed through error plugin, otherwise the classname of the object