Package rx.exceptions

Class OnErrorThrowable.OnNextValue

All Implemented Interfaces:
Serializable
Enclosing class:
OnErrorThrowable

public static class OnErrorThrowable.OnNextValue extends 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:
  • Field Details

  • Constructor Details

    • OnNextValue

      public OnNextValue(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 Details

    • getValue

      public 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 String renderValue(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