Class AWSExceptionHandler


  • @Internal
    public class AWSExceptionHandler
    extends Object
    Class to provide improved semantics over FatalExceptionClassifier.isFatal(Throwable, Consumer). FatalExceptionClassifier.isFatal(Throwable, Consumer) returns `false` for a fatal exception and `true` for a non-fatal exception.
    • Method Detail

      • withClassifier

        public static AWSExceptionHandler withClassifier​(org.apache.flink.connector.base.sink.throwable.FatalExceptionClassifier classifier)
      • consumeIfFatal

        public boolean consumeIfFatal​(Throwable t,
                                      java.util.function.Consumer<Exception> consumer)
        Passes a given Throwable t to a given Consumer consumer if the throwable is fatal. Returns `true` if the Throwable has been passed to the Consumer (i.e. it is fatal) and `false` otherwise.
        Parameters:
        t - a Throwable
        consumer - a Consumer to call if the passed throwable t is fatal.
        Returns:
        `true` if t is fatal, `false` otherwise.