Top Description Constructors Methods
io.reactivex.exceptions

public final Class Exceptions

extends Object
Class Inheritance
Imports
io.reactivex.annotations.*, io.reactivex.internal.util.ExceptionHelper

Utility class to help propagate checked exceptions and rethrow exceptions designated as fatal.

Constructor Summary

AccessConstructor and Description
private
Exceptions()

Utility class.

Method Summary

Modifier and TypeMethod and Description
public static RuntimeException

Returns:

because propagate itself throws an exception or error, this is a sort of phantom return value; propagate does not actually return anything
propagate
(Throwable
the exception to throw directly or wrapped
t
)

Convenience method to throw a RuntimeException and Error directly or wrap any other exception type into a RuntimeException.

public static void
throwIfFatal(Throwable
the Throwable to test and perhaps throw
t
)

Throws a particular Throwable only if it belongs to a set of "fatal" error varieties.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Exceptionsback to summary
private Exceptions()

Utility class.

Method Detail

propagateback to summary
public static RuntimeException propagate(Throwable t)

Convenience method to throw a RuntimeException and Error directly or wrap any other exception type into a RuntimeException.

Parameters
t:Throwable

the exception to throw directly or wrapped

Returns:RuntimeException

because propagate itself throws an exception or error, this is a sort of phantom return value; propagate does not actually return anything

Annotations
@NonNull
throwIfFatalback to summary
public static void throwIfFatal(Throwable t)

Throws a particular Throwable only if it belongs to a set of "fatal" error varieties. These varieties are as follows:

  • VirtualMachineError
  • ThreadDeath
  • LinkageError
This can be useful if you are writing an operator that calls user-supplied code, and you want to notify subscribers of errors encountered in that code by calling their onError methods, but only if the errors are not so catastrophic that such a call would be futile, in which case you simply want to rethrow the error.
Parameters
t:Throwable

the Throwable to test and perhaps throw

See Also
RxJava: StackOverflowError is swallowed (Issue #748)