Package akka.japi
Class Throwables$
- java.lang.Object
-
- akka.japi.Throwables$
-
public class Throwables$ extends java.lang.Object
Helper class for determining whether aThrowable
is fatal or not. User should only catch the non-fatal one,and keep rethrow the fatal one.Fatal errors are errors like
VirtualMachineError
(for example,OutOfMemoryError
andStackOverflowError
, subclasses ofVirtualMachineError
),ThreadDeath
,LinkageError
,InterruptedException
,ControlThrowable
.Note. this helper keep the same semantic with
NonFatal
in Scala. For example, all harmlessThrowable
s can be caught by:try { // dangerous stuff } catch(Throwable e) { if (Throwables.isNonFatal(e)){ log.error(e, "Something not that bad."); } else { throw e; }
-
-
Field Summary
Fields Modifier and Type Field Description static Throwables$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description Throwables$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isFatal(java.lang.Throwable throwable)
Returns true if the providedThrowable
is to be considered fatal, or false if it is to be considered non-fatalboolean
isNonFatal(java.lang.Throwable throwable)
Returns true if the providedThrowable
is to be considered non-fatal, or false if it is to be considered fatal
-
-
-
Field Detail
-
MODULE$
public static final Throwables$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
isNonFatal
public boolean isNonFatal(java.lang.Throwable throwable)
Returns true if the providedThrowable
is to be considered non-fatal, or false if it is to be considered fatal
-
isFatal
public boolean isFatal(java.lang.Throwable throwable)
Returns true if the providedThrowable
is to be considered fatal, or false if it is to be considered non-fatal
-
-