Skip to content

Commit a9dc184

Browse files
committed
Better error messages
1 parent f105279 commit a9dc184

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/ElasticInferenceServiceSparseEmbeddingsModel.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ private URI createUri() throws ElasticsearchStatusException {
119119
);
120120
} catch (URISyntaxException e) {
121121
throw new ElasticsearchStatusException(
122-
"Failed to create URI for taskType ["
123-
+ getTaskType()
122+
"Failed to create URI for service ["
123+
+ this.getConfigurations().getService()
124+
+ "] with taskType ["
125+
+ this.getTaskType()
124126
+ "] with model ["
125127
+ this.getServiceSettings().modelId()
126128
+ "]: "

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/completion/ElasticInferenceServiceCompletionModel.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ private URI createUri() throws ElasticsearchStatusException {
109109
return new URI(elasticInferenceServiceComponents().elasticInferenceServiceUrl() + "/api/v1/chat/completions");
110110
} catch (URISyntaxException e) {
111111
throw new ElasticsearchStatusException(
112-
"Failed to create URI for completion service: " + e.getMessage(),
112+
"Failed to create URI for service ["
113+
+ this.getConfigurations().getService()
114+
+ "] with taskType ["
115+
+ this.getTaskType()
116+
+ "]: "
117+
+ e.getMessage(),
113118
RestStatus.BAD_REQUEST,
114119
e
115120
);

0 commit comments

Comments
 (0)