Interface ErrorHandler


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
  • Field Details

    • THROW

      static final ErrorHandler THROW
      Exceptions are wrapped in an Imaging­Op­Exception and thrown. In such case, no result is available. This is the default handler.
    • LOG

      static final ErrorHandler LOG
      Exceptions are wrapped in a Log­Record and logged, usually at Level​.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 own Error­Handler instead of using this error action, because not everyone read logging records.

  • Method Details

    • handle

      void handle(ErrorHandler.Report details)
      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 in details.
      Parameters:
      details - information about the first error. If more than one error occurred, the other errors are reported as suppressed exceptions.