Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5675

JSONParser needs a little bit more context when reporting an error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • utils-1.10.2
    • Utils
    • None

    Description

      Occasionally a Key/Value Pair evaluates to an empty string. In that case, the error message is something like:

      Caused by: java.lang.IllegalArgumentException: Malformatted JSON key-value pair: 
      	at org.apache.felix.serializer.impl.json.JSONParser.parseKeyValue(JSONParser.java:106)
      	at org.apache.felix.serializer.impl.json.JSONParser.parseObject(JSONParser.java:203)
      	... 56 more
      

      This makes it very challenging to find where the error is in the file.

      In order to add more context, the previously-parsed Key/Value pair should also be output.

      Attachments

        Activity

          People

            dleangen David Leangen
            dleangen David Leangen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: