-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Ability to Propagate Errors when using Custom Boxing / Call #53
Comments
I'm unsure what you mean, mapping this response to the object is trivial, and you have a expandable system of validations and you can specify your own so they can fail if an object does not fullfill your requirements. Can you elaborate more? |
Looks like It wasn't very good example to explain. Lets say we have data models described below: User
Server Response
Now when I want to map some dictionary on server response, I want this process to be finished with error if error appeared during user property unboxing:
Here I want to receive errors if something wrong with User object. How to solve this problem? |
I get it now, you want to have ability to propagate errors up the chain, so we could add functionality to the mapper that when returning an NSError from a boxing/call it should treat that as failure and fail the whole mapping. @lazarev Would you like to try implementing that? should be straighforward, if not I'll try to find some time this weekend / next week to do it |
Lets say I have a JSON object like this:
And I wan't to map object like this:
I can map error with KZCall or by custom boxing. But this methods unable to specify any errors during certain class instantiation or mapping. Is there any way to fix it with current library implementation?
The text was updated successfully, but these errors were encountered: