diff --git a/src/main/java/io/cryostat/net/web/http/api/beta/MatchExpressionsPostHandler.java b/src/main/java/io/cryostat/net/web/http/api/beta/MatchExpressionsPostHandler.java index 683ffbc8af..3af88f5ad7 100644 --- a/src/main/java/io/cryostat/net/web/http/api/beta/MatchExpressionsPostHandler.java +++ b/src/main/java/io/cryostat/net/web/http/api/beta/MatchExpressionsPostHandler.java @@ -159,7 +159,7 @@ public IntermediateResponse handle(RequestParameters par throw new ApiException(400, "Unable to parse JSON", e); } catch (RollbackException e) { if (ExceptionUtils.indexOfType(e, ConstraintViolationException.class) >= 0) { - throw new ApiException(400, "Duplicate matchExpression", e); + throw new ApiException(409, "Duplicate matchExpression", e); } throw new ApiException(500, e); } catch (MatchExpressionValidationException e) { diff --git a/src/main/java/io/cryostat/net/web/http/api/v2/CredentialsPostHandler.java b/src/main/java/io/cryostat/net/web/http/api/v2/CredentialsPostHandler.java index 98d613edb4..a430ac1c44 100644 --- a/src/main/java/io/cryostat/net/web/http/api/v2/CredentialsPostHandler.java +++ b/src/main/java/io/cryostat/net/web/http/api/v2/CredentialsPostHandler.java @@ -144,7 +144,7 @@ public IntermediateResponse handle(RequestParameters params) throws ApiExc .body(null); } catch (RollbackException e) { if (ExceptionUtils.indexOfType(e, ConstraintViolationException.class) >= 0) { - throw new ApiException(400, "Duplicate matchExpression", e); + throw new ApiException(409, "Duplicate matchExpression", e); } throw new ApiException(500, e); } catch (MatchExpressionValidationException e) {