Skip to content

Commit 456ea68

Browse files
Refactoring
1 parent a044c3f commit 456ea68

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,10 @@ private void sendUnifiedCompletionRequest(InferenceActionProxy.Request request,
8484

8585
try {
8686
if (request.isStreaming() == false) {
87-
unifiedErrorFormatListener.onFailure(new ElasticsearchStatusException(
87+
throw new ElasticsearchStatusException(
8888
"The [chat_completion] task type only supports streaming, please try again with the _stream API",
8989
RestStatus.BAD_REQUEST
90-
));
91-
return;
90+
);
9291
}
9392

9493
UnifiedCompletionAction.Request unifiedRequest;

0 commit comments

Comments
 (0)