fixed the biller Id Saving problem added 404 not found url
This commit is contained in:
@@ -9,6 +9,7 @@ import org.springframework.http.*;
|
||||
import org.springframework.validation.FieldError;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.NoHandlerFoundException;
|
||||
|
||||
import com.billpaymentservice.bbps.dto.ResponseModel;
|
||||
|
||||
@@ -36,6 +37,18 @@ public class GlobalExceptionHandler {
|
||||
resp.setData(fieldErrors);
|
||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(resp);
|
||||
}
|
||||
|
||||
@ExceptionHandler(NoHandlerFoundException.class)
|
||||
public ResponseEntity<ResponseModel<?>> handleNotFound(NoHandlerFoundException ex) {
|
||||
logger.warn("Endpoint not found: {}", ex.getRequestURL());
|
||||
ResponseModel<?> resp = new ResponseModel<>(
|
||||
"Endpoint not found: " + ex.getRequestURL(),
|
||||
"FAILED",
|
||||
HttpStatus.NOT_FOUND.value(),
|
||||
null
|
||||
);
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(resp);
|
||||
}
|
||||
|
||||
@ExceptionHandler(AppException.class)
|
||||
public ResponseEntity<ResponseModel<?>> handleAppException(AppException ex) {
|
||||
|
||||
Reference in New Issue
Block a user