summaryrefslogtreecommitdiffstats
path: root/jdisc_core
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2021-06-01 13:36:29 +0200
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2021-06-01 14:05:22 +0200
commit7fb9940f15d712cd7f38e3e141302a5d7f85b2cc (patch)
treebb696046df5a858fbdf92af5758844b0fef3e235 /jdisc_core
parentad0bd43f50719672848f3cb3859fad0d28a9820d (diff)
Add 'onError' to ContentChannel
Diffstat (limited to 'jdisc_core')
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentChannel.java11
1 files changed, 11 insertions, 0 deletions
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) {}
+
}