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:
Blake Watters
2012-12-22 19:03:30 -05:00
parent 7984d4f2ac
commit 0a033596da
7 changed files with 37 additions and 10 deletions

View File

@@ -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

View File

@@ -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