k-paxian / dart-json-mapper

Serialize / Deserialize Dart Objects to / from JSON
https://pub.dev/packages/dart_json_mapper
Other
399 stars 33 forks source link

Add additional error output for subclass errors #206

Closed Norbert515 closed 1 year ago

Norbert515 commented 1 year ago

Hey,

I work with subclass serialization a lot. If the subclass cannot be found, the mapper errors out as it tries to access a null value with '!'. This makes for a pretty obscure error which is hard to spot the issue at first.

This PR fixes that and provides additional information.

Feel free to merge or provide feedback - Thanks!

k-paxian commented 1 year ago

Hey @Norbert515 ! Thank you so much for your time for this contribution. 🚀 ❤️ I've made a few corrections and released your feature. imho adding such light 3rd party dependency needs to be justified by significant value, otherwise it's always better to have -1 dependency 😄

Norbert515 commented 1 year ago

Agreed! Thanks for the merge :)