google / json_serializable.dart

Generates utilities to aid in serializing to/from JSON.
https://pub.dev/packages/json_serializable
BSD 3-Clause "New" or "Revised" License
1.54k stars 392 forks source link

Parsing error are logged without stack trace #1426

Closed moshe5745 closed 2 months ago

moshe5745 commented 2 months ago

It seems that when we get errors in parsing the error is logged without a stack trace. That makes the debugging of the error much more difficult. Eventually, we need to put a breakpoint in the generated fromJson function and there to see what happened.

This is an example of logging we get:

════════ Exception caught by widgets library ═══════════════════════════════════ type 'Null' is not a subtype of type 'SomeModel' in type cast
The relevant error-causing widget was:
═════════════════════════════════════════════════════════════════════════════

Is this a correct behavior or maybe we messed something with the logs in our App?

moshe5745 commented 2 months ago

The problem was in our App with some global error handler that killed the trace