Skip to content

Commit

Permalink
Merge pull request #84 from mutualmobile/development
Browse files Browse the repository at this point in the history
Adding new error condition as a warning for empty result sets
  • Loading branch information
cnstoll committed Jul 4, 2014
2 parents a1e8b73 + 127e537 commit 27ab270
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#MMRecord Changelog

##[1.4.1](https://github.com/mutualmobile/MMRecord/issues?milestone=9&state=closed) (Friday, July 4th, 2014)
**Fixed**
* **FIXED** an issue([#83](https://github.com/mutualmobile/MMRecord/issues/83)) where MMRecord treated empty result sets as request failures. (Andrea Cremaschi)

##[1.4.0](https://github.com/mutualmobile/MMRecord/issues?milestone=7&state=closed) (Friday, June 27th, 2014)
**New**
* Improved support for sub-entity inheritance. [#50](https://github.com/mutualmobile/MMRecord/issues/50) (Andrea Cremaschi)
Expand Down
2 changes: 1 addition & 1 deletion MMRecord.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'MMRecord'
s.version = '1.4.0'
s.version = '1.4.1'
s.license = 'MIT'
s.summary = 'A simple block based web service integration library.'
s.homepage = 'https://github.com/MutualMobile/MMRecord'
Expand Down
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 27ab270

Please sign in to comment.