Skip to content

Commit 058ec23

Browse files
Changing messaging for ILlegalArgumentException on duplicate model gr… (#1294) (#1300)
* Changing messaging for ILlegalArgumentException on duplicate model group creation. Signed-off-by: Nate Boot <[email protected]> * Adjusting the test. `./gradlew test` passes. Signed-off-by: Nate Boot <[email protected]> --------- Signed-off-by: Nate Boot <[email protected]> (cherry picked from commit a9687fc) Co-authored-by: Nate B <[email protected]>
1 parent 00bc098 commit 058ec23

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ public void createModelGroup(MLRegisterModelGroupInput input, ActionListener<Str
7575
listener
7676
.onFailure(
7777
new IllegalArgumentException(
78-
"The name you provided is already being used by another model with ID: "
79-
+ id
80-
+ ". Please provide a different name or add \"model_group_id\": \""
81-
+ id
82-
+ "\" to request body"
78+
"The name you provided is already being used by a model group with ID: " + id + "."
8379
)
8480
);
8581
}

plugin/src/test/java/org/opensearch/ml/model/MLModelGroupManagerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void test_ModelGroupNameNotUnique() throws IOException {//
143143
ArgumentCaptor<Exception> argumentCaptor = ArgumentCaptor.forClass(Exception.class);
144144
verify(actionListener).onFailure(argumentCaptor.capture());
145145
assertEquals(
146-
"The name you provided is already being used by another model with ID: model_group_ID. Please provide a different name or add \"model_group_id\": \"model_group_ID\" to request body",
146+
"The name you provided is already being used by a model group with ID: model_group_ID.",
147147
argumentCaptor.getValue().getMessage()
148148
);
149149

0 commit comments

Comments
 (0)