Skip to content

Commit

Permalink
#4 feat: binding result 관련 에러 사항 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
shoeone96 committed Nov 16, 2023
1 parent 60a0c97 commit ac06b82
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/com/example/board/exception/BindingException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.board.exception;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public class BindingException extends RuntimeException{
private String bindingMessages;

@Override
public String getMessage() {
return this.bindingMessages;
}
}
3 changes: 3 additions & 0 deletions src/main/java/com/example/board/response/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ public static Response<String> fail(Exception e) {
return new Response<>(e.getMessage(), 500, "fail");
}

public static Response<String> fail(String bindingErrors) {
return new Response<>(bindingErrors, 400, "fail");
}
}

0 comments on commit ac06b82

Please sign in to comment.