Define errorMessage as an informal protocol for returning error message representations rather than the description method. Document RKErrorMessage.

This commit is contained in:
Blake Watters
2012-09-20 08:04:12 -04:00
parent 3876263039
commit 04abcb8369
3 changed files with 25 additions and 9 deletions

View File

@@ -21,13 +21,28 @@
#import <Foundation/Foundation.h>
/**
A destination class for mapping simple remote error messages.
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
///-----------------------------------
/// @name Accessing Errror Information
///-----------------------------------
/**
The error message string mapped from the response payload
The error message to be presented to the user.
*/
@property (nonatomic, strong) NSString *errorMessage;
@property (nonatomic, copy) NSString *errorMessage;
/**
A dictionary of application specific information that accompanies the error message.
*/
@property (nonatomic, copy) NSDictionary *userInfo;
@end