Top Description Constructors Methods
com.fasterxml.jackson.databind.util

public Class ExceptionUtil

extends Object
Class Inheritance
Imports
java.io.IOException

Utility methods for dealing with exceptions/throwables
Since
2.15

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static <E extends Throwable> void
private static boolean

Returns:

whether the Throwable is a fatal error
isFatal
(Throwable
to check
throwable
)

It is important never to catch all Throwables.

public static void
rethrowIfFatal(Throwable
to check
throwable
)

It is important never to catch all Throwables.

public static <T> T
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ExceptionUtilback to summary
private ExceptionUtil()

Method Detail

_sneakyback to summary
private static <E extends Throwable> void _sneaky(Throwable e) throws Throwable-:E
Annotations
@SuppressWarnings:unchecked
isFatalback to summary
private static boolean isFatal(Throwable throwable)

It is important never to catch all Throwables. Some like InterruptedException should be rethrown. Based on scala.util.control.NonFatal.

Parameters
throwable:Throwable

to check

Returns:boolean

whether the Throwable is a fatal error

rethrowIfFatalback to summary
public static void rethrowIfFatal(Throwable throwable) throws Error, RuntimeException

It is important never to catch all Throwables. Some like InterruptedException should be rethrown. Based on scala.util.control.NonFatal. This method should be used with care.

If the Throwable is fatal, it is rethrown, otherwise, this method just returns. The input throwable is thrown if it is an Error or a RuntimeException. Otherwise, the method wraps the throwable in a RuntimeException and throws that.

Parameters
throwable:Throwable

to check

Exceptions
Error:
the input throwable if it is fatal
RuntimeException:
the input throwable if it is fatal - throws the original throwable if is a RuntimeException. Otherwise, wraps the throwable in a RuntimeException.
throwSneakyback to summary
public static <T> T throwSneaky(IOException e)