The JSON lib I'm currently using gives reasonably useful syntax error
messages, complete with line number and character offset in line. Of course,
as with any syntax error, that's approximate.

However, that position info is buried inside the library, and I'd have to do
a lot of surgery to the library to get line & offset as separate fields.
It's possible, of course -- it's just annoying.

So how about dropping the separate line & character fields, and simplifying
my original proposal to this:

"For an E_SYNTAX error, the ALTO server MAY provide the optional string
field "syntax-error" with a human-readable description of the syntax error.
If possible, this field should include position information such as line
number and offset within line. If nothing else, "syntax-error" could have
just the position. The format of "syntax-error" field is free-form. The
contents of that field should be given to the ALTO client developer, not the
end-user. If a syntax error occurs in a production environment, the ALTO
client should  log the "syntax-error" in an internal log file, tell the
end-user that there was an error communicating with the ALTO server, and
suggest the user forward that log file to the developers."

- Wendy Roome

From:  "Y. Richard Yang" <[email protected]>
Date:  Mon, October 14, 2013 00:54
To:  Richard Alimi <[email protected]>
Cc:  "Y. Richard Yang" <[email protected]>, Wendy Roome
<[email protected]>, IETF ALTO <[email protected]>
Subject:  Re: [alto] Adding explanation for E_SYNTAX error

Interesting thought. It appears a json parser, from what I used, will more
likely give only the line number. For example, try
http://jsonlint.com/

It typically gives a line number, and then some message on what is expected.
Hence, line # might be more likely available?

Richard


_______________________________________________
alto mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/alto

Reply via email to