beckchr / staxon

JSON via StAX
107 stars 47 forks source link

Add location (row/column) to JSON parse exception messages #6

Closed velodiver closed 12 years ago

velodiver commented 12 years ago

Can you add row and column information and an indication of what is causing the error to parse exception when parsing JSON?

For instance, XML errors provide this information:

<?xml version="1.0"?>value

format error ParseError at [row,col]:[1,39] Message: The end-tag for element type "test" must end with a '>' delimiter.

JSON parse exceptions provide less information:

{ "alice" : [ "bob":"charlie" , "david" : "edgar" } }

format error java.io.IOException: Unexpected symbol: COLON

Thank you,

Dave

beckchr commented 12 years ago

Added support for XMLStreamReader.getLocation(), exception messages contain location information.