Skip to content

Commit

Permalink
Changing messaging for ILlegalArgumentException on duplicate model gr… (
Browse files Browse the repository at this point in the history
#1294)

* Changing messaging for ILlegalArgumentException on duplicate model group creation.

Signed-off-by: Nate Boot <nateboot@amazon.com>

* Adjusting the test. `./gradlew test` passes.

Signed-off-by: Nate Boot <nateboot@amazon.com>

---------

Signed-off-by: Nate Boot <nateboot@amazon.com>
(cherry picked from commit a9687fc)
  • Loading branch information
nateynateynate authored and github-actions[bot] committed Sep 7, 2023
1 parent 99679bc commit 6eb3ac0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ public void createModelGroup(MLRegisterModelGroupInput input, ActionListener<Str
listener
.onFailure(
new IllegalArgumentException(
"The name you provided is already being used by another model with ID: "
+ id
+ ". Please provide a different name or add \"model_group_id\": \""
+ id
+ "\" to request body"
"The name you provided is already being used by a model group with ID: " + id + "."
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void test_ModelGroupNameNotUnique() throws IOException {//
ArgumentCaptor<Exception> argumentCaptor = ArgumentCaptor.forClass(Exception.class);
verify(actionListener).onFailure(argumentCaptor.capture());
assertEquals(
"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",
"The name you provided is already being used by a model group with ID: model_group_ID.",
argumentCaptor.getValue().getMessage()
);

Expand Down

0 comments on commit 6eb3ac0

Please sign in to comment.