mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-06-17 05:29:58 +08:00
Relax the use of use an the informal procotol for the errorMessage property in favor of the description method. closes #1104, closes #1087, closes #1095
* Change contract to the use the `description` method instead of `errorMessage`. This makes it work with any class out of the box * Add import for RKErrorMessage to the Support.h header so it is immediately available * Fix incorrect keyPath in the README.md * Add additional notes about how the errors are constructed to the README
This commit is contained in:
@@ -23,10 +23,6 @@
|
||||
/**
|
||||
The `RKErrorMessage` is a simple class used for representing error messages returned by a remote backend system with which the client application is communicating. Error messages are typically returned in a response body in the Client Error class (status code 4xx range).
|
||||
|
||||
## Error Message Informal Protocol
|
||||
|
||||
The `errorMessage` property method is the sole method of an informal protocol that must be adopted by objects wishing to represent error messages within RestKit. This protocol is by the `RKErrorFromMappingResult` function when constructing `NSError` messages from a mapped response body.
|
||||
|
||||
@see `RKErrorFromMappingResult`
|
||||
*/
|
||||
@interface RKErrorMessage : NSObject
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"<%@:%p error message = \"%@\" userInfo = %@>",
|
||||
NSStringFromClass([self class]), self, self.errorMessage, self.userInfo];
|
||||
return self.errorMessage;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user