Michael Vorburger created FINERACT-1124:
-------------------------------------------
Summary: Return clearer JSON validation errors to clients (instead
of HTTP 500)
Key: FINERACT-1124
URL: https://issues.apache.org/jira/browse/FINERACT-1124
Project: Apache Fineract
Issue Type: Bug
Reporter: Michael Vorburger
See FINERACT-932 for general background; on 06.08.20 (only) there were x2 of
these in logs of [https://www.fineract.dev|https://www.fineract.dev/], which
made me think that, in an ideal world, we could catch this and have
integrationt tests ensuring that we return clearer JSON validation errors to
clients instead of HTTP 500 internal server errors, e.g. in cases like this:
{noformat} java.lang.IllegalStateException: Not a JSON Array: "Brasil"
at com.google.gson.JsonElement.getAsJsonArray (JsonElement.java:107)
at
org.apache.fineract.infrastructure.core.serialization.JsonParserHelper.extractJsonArrayNamed
(JsonParserHelper.java:267)
at
org.apache.fineract.infrastructure.core.serialization.FromJsonHelper.extractJsonArrayNamed
(FromJsonHelper.java:174)
at
org.apache.fineract.portfolio.client.data.ClientDataValidator.validateForCreate
(ClientDataValidator.java:232)
at
org.apache.fineract.portfolio.client.service.ClientWritePlatformServiceJpaRepositoryImpl.createClient
(ClientWritePlatformServiceJpaRepositoryImpl.java:231){noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)