summaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/main/java/com/yahoo/jdisc/handler/OverloadException.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /jdisc_core/src/main/java/com/yahoo/jdisc/handler/OverloadException.java
Publish
Diffstat (limited to 'jdisc_core/src/main/java/com/yahoo/jdisc/handler/OverloadException.java')
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/handler/OverloadException.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/OverloadException.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/OverloadException.java
new file mode 100644
index 00000000000..22bd5cc14c7
--- /dev/null
+++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/OverloadException.java
@@ -0,0 +1,24 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.jdisc.handler;
+
+/**
+ * An exception to signal abort current action, as the container is overloaded.
+ * Just unroll state as cheaply as possible.
+ *
+ * <p>
+ * The contract of OverloadException (for Jetty) is:
+ * </p>
+ *
+ * <ol>
+ * <li>You must set the response yourself first, or you'll get 500 internal
+ * server error.</li>
+ * <li>You must throw it from handleRequest synchronously.</li>
+ * </ol>
+ *
+ * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a>
+ */
+public class OverloadException extends RuntimeException {
+ public OverloadException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}