blob: dd1327f7ccfe6405b35b23a1660bb5e450045d09 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.feed.client;
import java.util.Optional;
/**
* Signals that an error occurred during feeding
*
* @author bjorncs
*/
public class FeedException extends RuntimeException {
private final DocumentId documentId;
public FeedException(String message) {
super(message);
this.documentId = null;
}
public FeedException(DocumentId documentId, String message) {
super(message);
this.documentId = documentId;
}
public FeedException(String message, Throwable cause) {
super(message, cause);
this.documentId = null;
}
public FeedException(Throwable cause) {
super(cause);
this.documentId = null;
}
public FeedException(DocumentId documentId, Throwable cause) {
super(cause);
this.documentId = documentId;
}
public FeedException(DocumentId documentId, String message, Throwable cause) {
super(message, cause);
this.documentId = documentId;
}
public Optional<DocumentId> documentId() { return Optional.ofNullable(documentId); }
@Override
public String getMessage() {
return documentId != null ? "(" + documentId + ") " + super.getMessage() : super.getMessage();
}
}
|