Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Making a 4xx response body available in the error handlers. #119

Conversation

milancermak
Copy link
Contributor

Some web services send a body on 4xx responses containing data about the error, how to fix it, etc. I need to access the response body in the error handlers. This patch allows that.

@MugunthKumar
Copy link
Owner

I would recommend overriding MKNetworkOperation for doing custom error handling.

@milancermak
Copy link
Contributor Author

Fair enough.

@milancermak milancermak closed this Jun 9, 2012
@sspencer
Copy link

sspencer commented Aug 1, 2012

For future reference, I created a gist for overriding MKNetworkOperation here: https://gist.github.com/3222686

@Rupert-RR
Copy link

Obviously we can override the MKNetworkOperation, but this should be included in the core - as far as I am aware, according to the HTTP protocol, 4xx responses are supposed to return a body that contains information about the error so it is a standard requirement to be able to read the response body.
Personally I would favour returning the operation object as part of the error block, but that is an implementation detail.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants