Changed server response handling from NSException to NSError#54
Changed server response handling from NSException to NSError#54cnstoll merged 4 commits intomutualmobile:masterfrom
Conversation
…ception to a recoverable error.
There was a problem hiding this comment.
The assertion will only get triggered in DEBUG builds, so I don't think this is a terrible thing to do. However, I could be sold on having an error condition as a better way to handle this. An error is also more consistent with the way the rest of the library works.
|
That's fair, I will update the header ASAP. Thanks! |
|
The already-defined MMRecordErrorCodeInvalidResponseFormat seems applicable to this case, do you agree? |
|
Yeah I think so too 👍 |
|
Please let me know if there are any other recommended changes. |
Source/MMRecord/MMRecord.m
Outdated
There was a problem hiding this comment.
Subtle point, but MMRecord.m technically doesn't know anything about the AFResponseSerializer. Lets change this string to:
"The server response was in an unexpected format that could not be handled by MMRecord."
|
Done! |
|
Hehe, good catch Brian. I did not notice the encompassing () around the or clause, hence the confusion. |
Changed server response handling from NSException to NSError
|
Merged. Thanks Jeremy! |
If the server were to return something unexpected, it is often recoverable; as an NSException the app would simply crash.