nihalritgithub opened a new pull request, #171:
URL: https://github.com/apache/fineract-loan-origination/pull/171

   ## Description
   
   Fixes #161.
   
   Invalid request payloads can fall through to the generic exception handler 
and return HTTP 500 instead of HTTP 400.
   
   This change adds explicit handling for:
   
   - `MethodArgumentNotValidException` — returns 400 with field-level 
validation errors.
   - `HandlerMethodValidationException` — returns 400 for invalid request 
parameters while preserving 500 for return-value validation failures.
   - `HttpMessageNotReadableException` — returns 400 for malformed JSON and 
incompatible field types.
   
   The existing error response structure and unrelated exception mappings are 
preserved.
   
   ## Verification
   
   - [x] Spotless formatting applied to the changed test file; `spotless:check` 
passed.
   - [ ] `./mvnw clean verify` — not run; the full integration suite requires 
Docker.
   - [x] `apache-rat:check` passed.
   - [x] Focused Maven tests — 62 passed, 0 failures, 0 errors.
   - [x] `git diff --check` passed.
   - [ ] Frontend checks — not applicable; no frontend changes.
   
   Regression tests cover invalid amounts, currency and applicant fields, 
malformed JSON, incompatible numeric values, rejected requests not reaching the 
service, valid requests, and existing HTTP status handling.
   
   ## Checklist
   
   - [x] This PR contains one focused change.
   - [x] Regression tests have been added.
   - [x] The new test file includes the ASF license header.
   - [x] Documentation changes are not needed for this fix.
   - [x] The commit is GPG-signed.
   - [x] The project's AI Policy and ASF Generative Tooling Guidance have been 
reviewed and followed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to