Implementation of this protocol let you print custom validation error description for your custom schema format. More...
Instance Methods | |
(NSString *) | - errorDescriptionForObject:errorMessage:stackTrace: |
This method prints object with errorMessage string at specific path. More... | |
Implementation of this protocol let you print custom validation error description for your custom schema format.
Each validation NSError
has custom keys in dictionary which help to you debug the error. One of these keys is TyphoonRestClientErrorKeyFullDescription
, and if want good error description you may implement that protocol and register for your scheme format, using method registerValidationErrorPrinter:forFormatWithFileExtension: (TyphoonRestClient(Infrastructure))
By default, error printer implemented only for JSON schema format
- (NSString *) errorDescriptionForObject: | (id) | object | |
errorMessage: | (NSString *) | errorMessage | |
stackTrace: | (NSArray *) | stackTrace | |
This method prints object with errorMessage string at specific path.
for example for input: :
The output would be:
object | input object to print. Usually comes from response/request serialization |
errorMessage | error string to print |
stackTrace | - array of identifiers, which means stack trace (path to element with error). For JSON/Plist format, stackTrace contains only NSNumber (means array index) and NSString (means dictionary key) |