for the review

This commit is contained in:
himanshu
2025-10-28 15:46:31 +05:30
parent 4d501f7b4a
commit 92e71695a5
24 changed files with 331 additions and 284 deletions
@@ -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);
}
}
}