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 <[email protected]>

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

Signed-off-by: Nate Boot <[email protected]>

---------

Signed-off-by: Nate Boot <[email protected]>
  • Loading branch information
nateynateynate authored Sep 7, 2023
1 parent 285f7fe commit a9687fc
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 a9687fc

Please sign in to comment.