Skip to content

Commit 6742147

Browse files
[Inference API] Improve chunked results error message (#115807)
* Improve chunked results error message * Update RestStatus to conflict * precommit * Update docs/changelog/115807.yaml
1 parent d18824d commit 6742147

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/changelog/115807.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 115807
2+
summary: "[Inference API] Improve chunked results error message"
3+
area: Machine Learning
4+
type: enhancement
5+
issues: []

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results/ResultUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ public class ResultUtils {
1414

1515
public static ElasticsearchStatusException createInvalidChunkedResultException(String expectedResultName, String receivedResultName) {
1616
return new ElasticsearchStatusException(
17-
"Expected a chunked inference [{}] received [{}]",
18-
RestStatus.INTERNAL_SERVER_ERROR,
17+
"Received incompatible results. Check that your model_id matches the task_type of this endpoint. "
18+
+ "Expected chunked output of type [{}] but received [{}].",
19+
RestStatus.CONFLICT,
1920
expectedResultName,
2021
receivedResultName
2122
);

0 commit comments

Comments
 (0)