Skip to content

Commit

Permalink
Merge pull request #161 from github/nil-dictionary-error
Browse files Browse the repository at this point in the history
Improved error description and failure reason when the JSON dictionary is nil
  • Loading branch information
jspahrsummers committed Oct 10, 2013
2 parents 7eecee4 + 4da5c61 commit e69396c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Mantle/MTLJSONAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ - (id)initWithJSONDictionary:(NSDictionary *)JSONDictionary modelClass:(Class)mo
if (JSONDictionary == nil) {
if (error != NULL) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: NSLocalizedString(@"Invalid JSONDictionary", @""),
NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The JSONDictionary parameter is invalid.", @"")
NSLocalizedDescriptionKey: NSLocalizedString(@"Missing JSON dictionary", @""),
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:NSLocalizedString(@"%@ could not be created because no JSON dictionary was provided.", @""), NSStringFromClass(modelClass)],
};
*error = [NSError errorWithDomain:MTLJSONAdapterErrorDomain code:MTLJSONAdapterErrorInvalidJSONDictionary userInfo:userInfo];
}
Expand Down

0 comments on commit e69396c

Please sign in to comment.