mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Define errorMessage as an informal protocol for returning error message representations rather than the description method. Document RKErrorMessage.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user