From 7f105088cace9e8f3177414bc0cd07b144d5e59e Mon Sep 17 00:00:00 2001 From: Ming Wang Date: Fri, 22 Dec 2023 11:44:47 -0500 Subject: [PATCH] update error messages --- src/main/java/io/cryostat/recordings/RecordingHelper.java | 3 ++- src/main/java/io/cryostat/rules/Rules.java | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/cryostat/recordings/RecordingHelper.java b/src/main/java/io/cryostat/recordings/RecordingHelper.java index eaf21026b..336121f16 100644 --- a/src/main/java/io/cryostat/recordings/RecordingHelper.java +++ b/src/main/java/io/cryostat/recordings/RecordingHelper.java @@ -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)) { diff --git a/src/main/java/io/cryostat/rules/Rules.java b/src/main/java/io/cryostat/rules/Rules.java index 91c2f4ca6..6acc0b9e6 100644 --- a/src/main/java/io/cryostat/rules/Rules.java +++ b/src/main/java/io/cryostat/rules/Rules.java @@ -149,7 +149,11 @@ public RestResponse 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); } } }