Uploaded image for project: 'Apache Fineract'
  1. Apache Fineract
  2. FINERACT-1124

Return clearer JSON validation errors to clients (instead of HTTP 500)

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Auto Closed
    • None
    • None
    • None

    Description

      See FINERACT-932 for general background; on 06.08.20 (only) there were x2 of these in logs of 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:

       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)

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            vorburger Michael Vorburger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment