Skip to content

Commit 2e479a9

Browse files
committed
Revert changes to InferenceException
1 parent bf420c8 commit 2e479a9

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferenceException.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,11 @@
88
package org.elasticsearch.xpack.inference;
99

1010
import org.elasticsearch.ElasticsearchException;
11-
import org.elasticsearch.ExceptionsHelper;
12-
import org.elasticsearch.rest.RestStatus;
11+
import org.elasticsearch.ElasticsearchWrapperException;
1312

14-
public class InferenceException extends ElasticsearchException {
13+
public class InferenceException extends ElasticsearchException implements ElasticsearchWrapperException {
1514
public InferenceException(String message, Throwable cause, Object... args) {
1615
super(message, cause, args);
1716
}
1817

19-
@Override
20-
public RestStatus status() {
21-
// Override status so that we get the status of the cause while retaining the message of the inference exception when emitting to
22-
// XContent
23-
RestStatus status = RestStatus.INTERNAL_SERVER_ERROR;
24-
Throwable cause = getCause();
25-
if (cause != null) {
26-
status = ExceptionsHelper.status(cause);
27-
}
28-
29-
return status;
30-
}
3118
}

0 commit comments

Comments
 (0)