public interface ErrorHandler
Action to perform when errors occurred while reading or writing some tiles in an image.
The most typical actions are throwing an exception or logging a warning.
- Since:
- 1.1
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Information about errors that occurred while reading or writing tiles in an image. -
Field Summary
Modifier and TypeFieldDescriptionstatic final ErrorHandler
Exceptions are wrapped in aLogRecord
and logged, usually atLevel.WARNING
.static final ErrorHandler
Exceptions are wrapped in anImagingOpException
and thrown. -
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(ErrorHandler.Report details) Invoked after errors occurred in one or many tiles.
-
Field Details
-
THROW
Exceptions are wrapped in anImagingOpException
and thrown. In such case, no result is available. This is the default handler. -
LOG
Exceptions are wrapped in aLogRecord
and logged, usually 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.
-
-
Method Details
-
handle
Invoked after errors occurred in one or many tiles. This method may be invoked an arbitrary time after the error occurred, and may aggregate errors that occurred in more than one tile.Multi-threading
If the image processing was splitted between many worker threads, this method may be invoked from any of those threads. However, the invocation should happen after all threads terminated, either successfully or with an error reported indetails
.- Parameters:
details
- information about the first error. If more than one error occurred, the other errors are reported as suppressed exceptions.
-