fixed the biller Id Saving problem added 404 not found url

This commit is contained in:
Lincpay Tech
2025-11-12 16:46:59 +05:30
parent d24d920cce
commit 84ad9a2dec
15 changed files with 377 additions and 18 deletions
@@ -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) {