Skip to content

Commit

Permalink
Adding a new empty result set warning error code
Browse files Browse the repository at this point in the history
  • Loading branch information
Conrad Stoll committed Jul 4, 2014
1 parent c188e61 commit aadc1c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/MMRecord/MMRecord.m
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ + (NSArray*)recordsFromResponseObject:(id)responseObject
[parameters setObject:responseObject forKey:MMRecordDebuggerParameterResponseObject];
}

[debugger handleErrorCode:MMRecordErrorCodeInvalidResponseFormat withParameters:parameters];
[debugger handleErrorCode:MMRecordErrorCodeEmptyResultSet withParameters:parameters];
return nil;
}

Expand Down
1 change: 1 addition & 0 deletions Source/MMRecord/MMRecordDebugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ typedef NS_ENUM(NSInteger, MMRecordErrorCode) {
MMRecordErrorCodeMissingRecordPrimaryKey = 3,
MMRecordErrorCodeInvalidEntityDescription = 4,
MMRecordErrorCodeInvalidResponseFormat = 6,
MMRecordErrorCodeEmptyResultSet = 7,
MMRecordErrorCodeCoreDataFetchError = 700,
MMRecordErrorCodeCoreDataSaveError = 701,
MMRecordErrorCodeUnknown = 999
Expand Down
5 changes: 5 additions & 0 deletions Source/MMRecord/MMRecordDebugger.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ - (MMRecordLoggingLevel)loggingLevelForErrorCode:(MMRecordErrorCode)errorCode {
return MMRecordLoggingLevelInfo;
case MMRecordErrorCodeInvalidEntityDescription:
return MMRecordLoggingLevelInfo;
case MMRecordErrorCodeEmptyResultSet:
return MMRecordLoggingLevelInfo;
default:
break;
}
Expand Down Expand Up @@ -248,6 +250,9 @@ - (NSString *)descriptionForErrorCode:(MMRecordErrorCode)errorCode {
result = NSLocalizedString(@"Invalid Response Format.",
@"The server response was in an unexpected format that could not be handled by MMRecord.");
break;
case MMRecordErrorCodeEmptyResultSet:
result = NSLocalizedString(@"Empty Result Set.", @"The result set returned from the server is empty. This is a warning, and may not be the result an error.");
break;
case MMRecordErrorCodeMissingRecordPrimaryKey:
result = NSLocalizedString(@"Missing Record Primary Key. No primary key was found for this proto record. This could mean that the primary key was not defined on the Managed Object Model, or that no primary key was injected into the population process.",
@"Missing Record Primary Key. No primary key was found for this proto record. This could mean that the primary key was not defined on the Managed Object Model, or that no primary key was injected into the population process.");
Expand Down

0 comments on commit aadc1c3

Please sign in to comment.