public final class Exceptions extends Object
Modifier and Type | Field and Description |
---|---|
static Fn<Throwable,Throwable> |
cause
Get the
cause of a Throwable . |
static Fn<Throwable,String> |
message
Get the
message of a Throwable . |
Modifier and Type | Method and Description |
---|---|
static RuntimeException |
asRuntimeException(Exception e)
If you need to rethrow checked exceptions as RuntimeException, this method will
ensure a sensible RuntimeException being acquired.
|
public static RuntimeException asRuntimeException(Exception e)
try { someMethod(); // may throw checked Exception } catch (Exception e) { throw asRuntimeException(e); }
e
- The exception.Copyright © 2016. All rights reserved.