Skip to content

Commit

Permalink
use more specific response code for duplicate matchexpression
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Sep 8, 2023
1 parent cac821f commit cbb0d6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public IntermediateResponse<MatchedMatchExpression> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public IntermediateResponse<Void> 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) {
Expand Down

0 comments on commit cbb0d6f

Please sign in to comment.