You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@johnzon.apache.org by David Blevins <da...@gmail.com> on 2022/04/30 23:10:35 UTC

Catalog of deserialization error messages as they are now (PR #90)

Hi All,

Starting the work on improving the exception messages so that they can show json if possible.  If they do show json, it ideally uses snippet.

I wrote the test first and it occurred to me it could be really useful to push this first so all of us can easily see a diff of what the error message is now and what it will be when new PRs are sent.  There are other nice perks such as it can help us see where we're at and what kind of user experience people get and track improvements over time.


-David



Exception handling improvements (was Re: Catalog of deserialization error messages as they are now (PR #90))

Posted by David Blevins <da...@gmail.com>.
Ok folks,

I've done a first round of improvements on the exception handling:

 - It's a lot clearer what's going on on both the java and json side of the equation.

 - I've also attempted to fix any situations I spotted where we were calling jsonValue.toString() and potentially serializing several GB of json strings.

 - The previously mentioned PR #90 uncovered a bug that we did not have exception handling for null values in primitive arrays.  The message you would get is JVM-specific and therefore was not testable.  The new handling prints the exact array index that is null.

Here's the PR for us to evaluate:

 - https://github.com/apache/johnzon/pull/91

Note, I didn't address any situations where we printed a full json string.  If we're concerned about those scenarios and time permits after this PR I can take a look.  I'd just ask to please not address those before this PR is merged and potentially cause merge conflicts.

Ideally there are no commits to MappingParserImpl while this PR is open as all the changes are there and any conflict basically means redoing all the work.


-David


> On Apr 30, 2022, at 4:10 PM, David Blevins <da...@gmail.com> wrote:
> 
> Hi All,
> 
> Starting the work on improving the exception messages so that they can show json if possible.  If they do show json, it ideally uses snippet.
> 
> I wrote the test first and it occurred to me it could be really useful to push this first so all of us can easily see a diff of what the error message is now and what it will be when new PRs are sent.  There are other nice perks such as it can help us see where we're at and what kind of user experience people get and track improvements over time.
> 
> 
> -David
> 
>