forked from BAEKDODAM/ImageTrip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request BAEKDODAM#20 from LinaKK/feat/member
Feat/member
- Loading branch information
Showing
3 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
17 changes: 16 additions & 1 deletion
17
src/main/java/com/ImageTrip/exception/GlobalExceptionAdvice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
package com.ImageTrip.exception;public class GlobalExceptionAdvice { | ||
package com.ImageTrip.exception; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
|
||
@RestControllerAdvice | ||
public class GlobalExceptionAdvice { | ||
|
||
@ExceptionHandler | ||
public ResponseEntity handleBusinessLogicException(BusinessLogicException e) { | ||
String message = e.getMessage(); | ||
|
||
return new ResponseEntity<>(message, HttpStatus.valueOf(e.getExceptionCode().getStatus())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters