Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Feb 6, 2024
1 parent d6743d6 commit 3697c51
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/cryostat/ExceptionMappers.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.openjdk.jmc.rjmx.ConnectionException;

import io.cryostat.targets.TargetConnectionManager;

import io.cryostat.util.EntityExistsException;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.smallrye.mutiny.TimeoutException;
import jakarta.inject.Inject;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/cryostat/recordings/RecordingHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.openjdk.jmc.rjmx.services.jfr.IRecordingDescriptor;

import io.cryostat.ConfigProperties;
import io.cryostat.EntityExistsException;
import io.cryostat.Producers;
import io.cryostat.core.EventOptionsBuilder;
import io.cryostat.core.net.JFRConnection;
Expand All @@ -60,6 +59,7 @@
import io.cryostat.recordings.Recordings.Metadata;
import io.cryostat.targets.Target;
import io.cryostat.targets.TargetConnectionManager;
import io.cryostat.util.EntityExistsException;
import io.cryostat.util.HttpMimeType;
import io.cryostat.ws.MessagingServer;
import io.cryostat.ws.Notification;
Expand Down
10 changes: 2 additions & 8 deletions src/main/java/io/cryostat/rules/Rules.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/
package io.cryostat.rules;

import io.cryostat.EntityExistsException;
import io.cryostat.V2Response;
import io.cryostat.expressions.MatchExpression;
import io.cryostat.util.EntityExistsException;

import io.vertx.core.json.JsonObject;
import io.vertx.mutiny.core.eventbus.EventBus;
Expand Down Expand Up @@ -69,7 +69,7 @@ public RestResponse<V2Response> create(Rule rule) {
}
boolean ruleExists = Rule.getByName(rule.name) != null;
if (ruleExists) {
throw new RuleExistsException(rule.name);
throw new EntityExistsException("Rule", rule.name);
}
if (rule.description == null) {
rule.description = "";
Expand Down Expand Up @@ -146,10 +146,4 @@ public RestResponse<V2Response> delete(@RestPath String name, @RestQuery boolean
rule.delete();
return RestResponse.ok(V2Response.json(Response.Status.OK, null));
}

public static class RuleExistsException extends EntityExistsException {
RuleExistsException(String name) {
super("Rule ", name);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.cryostat;
package io.cryostat.util;

import jakarta.ws.rs.ClientErrorException;
import jakarta.ws.rs.core.Response;
Expand Down

0 comments on commit 3697c51

Please sign in to comment.