From aadc1c30a5f6a7f384cd7d72bd1c61d47d0984bb Mon Sep 17 00:00:00 2001 From: Conrad Stoll Date: Fri, 4 Jul 2014 10:07:45 -0500 Subject: [PATCH 1/2] Adding a new empty result set warning error code --- Source/MMRecord/MMRecord.m | 2 +- Source/MMRecord/MMRecordDebugger.h | 1 + Source/MMRecord/MMRecordDebugger.m | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/MMRecord/MMRecord.m b/Source/MMRecord/MMRecord.m index eb93d3d..10948ff 100644 --- a/Source/MMRecord/MMRecord.m +++ b/Source/MMRecord/MMRecord.m @@ -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; } diff --git a/Source/MMRecord/MMRecordDebugger.h b/Source/MMRecord/MMRecordDebugger.h index 8417811..a7cc93b 100644 --- a/Source/MMRecord/MMRecordDebugger.h +++ b/Source/MMRecord/MMRecordDebugger.h @@ -78,6 +78,7 @@ typedef NS_ENUM(NSInteger, MMRecordErrorCode) { MMRecordErrorCodeMissingRecordPrimaryKey = 3, MMRecordErrorCodeInvalidEntityDescription = 4, MMRecordErrorCodeInvalidResponseFormat = 6, + MMRecordErrorCodeEmptyResultSet = 7, MMRecordErrorCodeCoreDataFetchError = 700, MMRecordErrorCodeCoreDataSaveError = 701, MMRecordErrorCodeUnknown = 999 diff --git a/Source/MMRecord/MMRecordDebugger.m b/Source/MMRecord/MMRecordDebugger.m index ef81ede..a2f41c3 100644 --- a/Source/MMRecord/MMRecordDebugger.m +++ b/Source/MMRecord/MMRecordDebugger.m @@ -163,6 +163,8 @@ - (MMRecordLoggingLevel)loggingLevelForErrorCode:(MMRecordErrorCode)errorCode { return MMRecordLoggingLevelInfo; case MMRecordErrorCodeInvalidEntityDescription: return MMRecordLoggingLevelInfo; + case MMRecordErrorCodeEmptyResultSet: + return MMRecordLoggingLevelInfo; default: break; } @@ -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."); From 127e5372071716ad5fb821fa3549a77e6c3042e9 Mon Sep 17 00:00:00 2001 From: Conrad Stoll Date: Fri, 4 Jul 2014 10:10:08 -0500 Subject: [PATCH 2/2] Updating Version --- CHANGELOG.md | 4 ++++ MMRecord.podspec | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b793aec..c66b9f8 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/MMRecord.podspec b/MMRecord.podspec index 1eca4cd..e5dc3eb 100644 --- a/MMRecord.podspec +++ b/MMRecord.podspec @@ -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'