From 7fb9940f15d712cd7f38e3e141302a5d7f85b2cc Mon Sep 17 00:00:00 2001 From: Bjørn Christian Seime Date: Tue, 1 Jun 2021 13:36:29 +0200 Subject: Add 'onError' to ContentChannel --- .../src/main/java/com/yahoo/jdisc/handler/ContentChannel.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'jdisc_core') diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentChannel.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentChannel.java index a1a4503eff2..b8b2d123a13 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentChannel.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentChannel.java @@ -47,4 +47,15 @@ public interface ContentChannel { */ void close(CompletionHandler handler); + + /** + * Invoked when an error occurs during processing of request content. Signals that the caller was + * unable to write all data to this ContentChannel. + * + * This method can be invoked at any time after the content channel is created, but it's never invoked after {@link #close(CompletionHandler)}. + * {@link #close(CompletionHandler)} will be invoked immediately after this method returning + * (no intermediate calls to #{@link #write(ByteBuffer, CompletionHandler)}). + */ + default void onError(Throwable error) {} + } -- cgit v1.2.3