Skip to content

Commit

Permalink
[feat] - change the text plain response to json
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroVidalDev committed Apr 15, 2024
1 parent d83325d commit 536273c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.pedro.sphynx.application.dtos.error;

public record Error(String message) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public ResponseEntity noSuchElement(){

@ExceptionHandler(Validation.class)
public ResponseEntity validation(Validation e){
return ResponseEntity.badRequest().body(e.getMessage());
return ResponseEntity.badRequest().body(new Error(e.getMessage()));
}
}

0 comments on commit 536273c

Please sign in to comment.