Package io.reactivex.rxjava3.exceptions
Class Exceptions
- java.lang.Object
-
- io.reactivex.rxjava3.exceptions.Exceptions
-
public final class Exceptions extends java.lang.ObjectUtility class to help propagate checked exceptions and rethrow exceptions designated as fatal.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateExceptions()Utility class.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NonNull java.lang.RuntimeExceptionpropagate(@NonNull java.lang.Throwable t)Convenience method to throw aRuntimeExceptionandErrordirectly or wrap any other exception type into aRuntimeException.static voidthrowIfFatal(@NonNull java.lang.Throwable t)Throws a particularThrowableonly if it belongs to a set of "fatal" error varieties.
-
-
-
Method Detail
-
propagate
@NonNull public static @NonNull java.lang.RuntimeException propagate(@NonNull @NonNull java.lang.Throwable t)
Convenience method to throw aRuntimeExceptionandErrordirectly or wrap any other exception type into aRuntimeException.- Parameters:
t- the exception to throw directly or wrapped- Returns:
- because
propagateitself throws an exception or error, this is a sort of phantom return value;propagatedoes not actually return anything
-
throwIfFatal
public static void throwIfFatal(@NonNull @NonNull java.lang.Throwable t)
Throws a particularThrowableonly if it belongs to a set of "fatal" error varieties. These varieties are as follows:VirtualMachineErrorThreadDeathLinkageError
onErrormethods, 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- theThrowableto test and perhaps throw- See Also:
- RxJava: StackOverflowError is swallowed (Issue #748)
-
-