Package org.apache.sis.image
Enum ErrorAction
- All Implemented Interfaces:
Serializable
,Comparable<ErrorAction>
,java.lang.constant.Constable
,ErrorHandler
Some common ways to handle exceptions occurring during tile calculation.
This class provides the implementations of
ErrorHandler
static constants.- Since:
- 1.1
- Version:
- 1.1
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface org.apache.sis.image.ErrorHandler
ErrorHandler.Report
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionExceptions are wrapped in aLogRecord
and logged atLevel.WARNING
.Exceptions are wrapped in anImagingOpException
and thrown. -
Field Summary
Fields inherited from interface org.apache.sis.image.ErrorHandler
LOG, THROW
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(ErrorHandler.Report details) Logs the given record or throws its exception, depending onthis
enumeration value.static ErrorAction
Returns the enum constant of this type with the specified name.static ErrorAction[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
THROW
Exceptions are wrapped in anImagingOpException
and thrown. In such case, no result is available. This is the default action. -
LOG
Exceptions are wrapped in aLogRecord
and logged atLevel.WARNING
. Only one log record is created for all tiles that failed for the same operation on the same image. A partial result may be available.Users are encouraged to use
THROW
or to specify their ownErrorHandler
instead of using this error action, because not everyone read logging records.
-
-
Constructor Details
-
ErrorAction
private ErrorAction()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
handle
Logs the given record or throws its exception, depending onthis
enumeration value. This method is implemented as a matter of principle but not invoked forErrorAction
enumeration values.- Specified by:
handle
in interfaceErrorHandler
- Parameters:
details
- information about the first error. If more than one error occurred, the other errors are reported as suppressed exceptions.
-