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
Support for server error Mantle objects #31
Conversation
When errorResultClass is supplied, Overcoat attempts to instantiate an error object from the response if errors are returned from AFNetworking.
Thanks for submitting the PR! I am not sure about the API changes though. I think it should be enough to have a single method to set the error class for all requests instead of adding the extra What do you think? |
Ah, you're thinking like a property on the OVCClient? That's a good idea :) That way no APIs get changed for the requests. |
Yeah, I meant a property. |
Or perhaps an init method plus a read-only property. |
Hum, that's true. I'm thinking this isn't something you'd want to change once the client is created (just like |
There, made some changes. Take a look at it and see if it feels like something you want in this nice little module of yours. Also, I'm not too sure about the description in the method/property docs, feel free to let me know of any other changes you see fit! I'll get back tomorrow 😃 |
Thank you! I'll have a look at the changes during the weekend. |
return [self clientWithBaseURL:url account:account errorResultClass:nil]; | ||
} | ||
|
||
+ (instancetype)clientWithBaseURL:(NSURL *)url account:(ACAccount *)account errorResultClass:(Class)errorResultClass { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not add + clientWithBaseURL:(NSURL *)url errorResultClass:(Class)errorResultClass
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed :)
LGTM. Thanks Martin! |
Support for server error Mantle objects
Yay! |
When errorResultClass is supplied, Overcoat attempts to instantiate an error object from the response if errors are returned from AFNetworking.
As discussed in #21