aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-feed-client-api/src/main/java/ai/vespa/feed/client/ResultException.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespa-feed-client-api/src/main/java/ai/vespa/feed/client/ResultException.java')
-rw-r--r--vespa-feed-client-api/src/main/java/ai/vespa/feed/client/ResultException.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/vespa-feed-client-api/src/main/java/ai/vespa/feed/client/ResultException.java b/vespa-feed-client-api/src/main/java/ai/vespa/feed/client/ResultException.java
new file mode 100644
index 00000000000..27803898c01
--- /dev/null
+++ b/vespa-feed-client-api/src/main/java/ai/vespa/feed/client/ResultException.java
@@ -0,0 +1,29 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package ai.vespa.feed.client;
+
+import ai.vespa.feed.client.DocumentId;
+import ai.vespa.feed.client.FeedException;
+import ai.vespa.feed.client.OperationParameters;
+
+import java.util.Optional;
+
+/**
+ * Signals that the document API in the feed container returned a failure result for a feed operation.
+ *
+ * @author jonmv
+ */
+public class ResultException extends FeedException {
+
+ private final String trace;
+
+ public ResultException(DocumentId documentId, String message, String trace) {
+ super(documentId, message);
+ this.trace = trace;
+ }
+
+ /** Holds the trace, if the failed operation had a {@link OperationParameters#tracelevel(int)} higher than 0. */
+ public Optional<String> getTrace() {
+ return Optional.ofNullable(trace);
+ }
+
+}