for the review
This commit is contained in:
@@ -5,12 +5,13 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import com.billpaymentservice.bbps.dto.GeneralResp;
|
||||
import com.billpaymentservice.bbps.dto.ResponseModel;
|
||||
|
||||
@ControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
|
||||
@ExceptionHandler(CustomException.class)
|
||||
public ResponseEntity<GeneralResp> handleCustomException(CustomException ex) {
|
||||
return new ResponseEntity<>(ex.getGeneralResp(), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
public ResponseEntity<ResponseModel> handleCustomException(CustomException ex) {
|
||||
return new ResponseEntity<>(ex.getResponseModel(), HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user