Skip Menu |

This queue is for tickets about the JSON-DWIW CPAN distribution.

Report information
The Basics
Id: 29581
Status: resolved
Priority: 0/
Queue: JSON-DWIW

People
Owner: dowens [...] cpan.org
Requestors: tmetro [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.13
  • 0.14
Fixed in: 0.15



Subject: format of syntax error message
When trying to parse a JSON string I received the following error message: syntax error at byte 3437620 There are a few things wrong with this: 1. It has no information identifying what generated the message. Was it Perl, some module, etc.? 2. The byte offset appears to be beyond the end of the string, which was loaded from a file with 207,028 bytes. If the string has been converted into 2-byte Unicode characters, then that needs to be specified. 3. It would be more helpful if it dumped a fragment of the string where the syntax error occurs. I don't know if this is fixed in 0.14, as I didn't see a change log. (At the moment I'm using a Win32 version of ActiveState's Perl, and thus limited to their built packages.)
This is not fixed in version 0.14. I didn't realize there were still bad error messages like that. Also, on Windows, that part of the code goes down a different path to get around problems I was running into with variable macros on Windows. I'll go through and refactor the way error messages are generated so that you get back the module name and version, and the location of the error in the input string, with byte offset, character offset, line number, and byte and character columns within that line. On Sun Sep 23 15:48:52 2007, tmetro@cpan.org wrote: Show quoted text
> When trying to parse a JSON string I received the following error message: > > syntax error at byte 3437620 > > There are a few things wrong with this: > > 1. It has no information identifying what generated the message. Was it > Perl, some module, etc.? > > 2. The byte offset appears to be beyond the end of the string, which was > loaded from a file with 207,028 bytes. If the string has been converted > into 2-byte Unicode characters, then that needs to be specified. > > 3. It would be more helpful if it dumped a fragment of the string where > the syntax error occurs. > > > I don't know if this is fixed in 0.14, as I didn't see a change log. (At > the moment I'm using a Win32 version of ActiveState's Perl, and thus > limited to their built packages.)
I've updated the error messages in version 0.15 to include the character offset, line number, etc.