Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get notified if a key is missing #31

Closed
s4cha opened this issue Feb 6, 2017 · 3 comments
Closed

Get notified if a key is missing #31

s4cha opened this issue Feb 6, 2017 · 3 comments

Comments

@s4cha
Copy link
Member

s4cha commented Feb 6, 2017

Find a way to get notified if a parsing error occurs, for example a missing key

@maxkonovalov
Copy link
Member

@s4cha how about making the deserialize func throwing?

@s4cha
Copy link
Member Author

s4cha commented Apr 13, 2017

@maxkonovalov , good question :)

Arrow didn't have error handling (on purpose) but this is something we can discuss. Having given this some time I think it might not be worth it. I personally never had the need to test errors in JSON parsing as I believe that this is an Api-side problem.

On the iOS side, Unit tests test against local JSON files to make sure parsing works as expected.
On the backed side, unit tests test that the api sends the correct JSON structures.

Could you elaborate on a concrete case where we need to catch parsing errors?

@maxkonovalov
Copy link
Member

@s4cha agreed, I don't have such use cases either. For me it works perfect just to do nothing if the key is not there or could not be parsed. Other frameworks usually provide a way to specify a fallback value for that case.

@s4cha s4cha closed this as completed Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants