Skip to content

Commit

Permalink
update error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Jan 23, 2024
1 parent 71ab032 commit 7f10508
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/io/cryostat/recordings/RecordingHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ public ActiveRecording startRecording(
if (!restart) {
throw new BadRequestException(
String.format(
"Recording with name \"%s\" already exists",
"Recording with name \"%s\" already exists. Rename"
+ " the recording and try again.",
recordingName));
}
if (!ActiveRecording.deleteFromTarget(target, recordingName)) {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/io/cryostat/rules/Rules.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ public RestResponse<V2Response> delete(@RestPath String name, @RestQuery boolean

static class RuleExistsException extends ClientErrorException {
RuleExistsException(String ruleName) {
super("Rule with name " + ruleName + " already exists", Response.Status.CONFLICT);
super(
"Rule with name "
+ ruleName
+ " already exists. Rename the rule and try again.",
Response.Status.CONFLICT);
}
}
}

0 comments on commit 7f10508

Please sign in to comment.