Skip to content

Commit

Permalink
added validation exception messages
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Toepker <[email protected]>
  • Loading branch information
toepkerd-zz committed Jun 7, 2024
1 parent 9ad5a15 commit a5d8a47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class DeleteCommentRequest : ActionRequest {

override fun validate(): ActionRequestValidationException? {
if (commentId.isBlank()) {
return ActionRequestValidationException()
val exception = ActionRequestValidationException()
exception.addValidationError("comment id must not be blank")
return exception
}
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ class IndexCommentRequest : ActionRequest {
if (method == RestRequest.Method.POST && entityId.isBlank() ||
method == RestRequest.Method.PUT && commentId.isBlank()
) {
return ActionRequestValidationException()
val exception = ActionRequestValidationException()
exception.addValidationError("id must not be blank")
return exception
}
return null
}
Expand Down

0 comments on commit a5d8a47

Please sign in to comment.