Interface ErrorHandler<T>

Type Parameters:
T - the type of context associated with the error (e.g., the failed task or message)
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ErrorHandler<T>
Functional interface for handling errors during tasks.

The error handler can log the error or escalate the failure depending on the context.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handleError(Throwable e, T context)
    Handles the given Throwable in the context of the provided value.
  • Method Details

    • handleError

      void handleError(Throwable e, T context)
      Handles the given Throwable in the context of the provided value.
      Parameters:
      e - the exception that occurred
      context - the context or input that caused the exception