diff options
author | NicoleYarroch <nicole@livio.io> | 2017-09-08 14:45:34 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2017-09-08 14:45:34 -0400 |
commit | e5819c9778ac0b39437c0ac9324b9fd12f09640f (patch) | |
tree | d16ed730c629eea62adb57a0b1e87c1396ffce50 | |
parent | e70cf3596b2da2414f0846d11eb68dec7f3fd156 (diff) | |
download | sdl_ios-e5819c9778ac0b39437c0ac9324b9fd12f09640f.tar.gz |
Fixed error names
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r-- | SmartDeviceLink/SDLError.h | 3 | ||||
-rw-r--r-- | SmartDeviceLink/SDLError.m | 8 | ||||
-rw-r--r-- | SmartDeviceLink/SDLErrorConstants.h | 6 | ||||
-rw-r--r-- | SmartDeviceLink/SDLFileManager.m | 4 | ||||
-rw-r--r-- | SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m | 14 |
5 files changed, 22 insertions, 13 deletions
diff --git a/SmartDeviceLink/SDLError.h b/SmartDeviceLink/SDLError.h index 25bafcdc4..9c4911d77 100644 --- a/SmartDeviceLink/SDLError.h +++ b/SmartDeviceLink/SDLError.h @@ -39,7 +39,8 @@ extern SDLErrorDomain *const SDLErrorDomainFileManager; + (NSError *)sdl_fileManager_noKnownFileError; + (NSError *)sdl_fileManager_unableToStartError; + (NSError *)sdl_fileManager_unableToUploadError; -+ (NSError *)sdl_fileManager_unableTo__ErrorWithUserInfo:(NSDictionary *)userInfo; ++ (NSError *)sdl_fileManager_unableToUpload_ErrorWithUserInfo:(NSDictionary *)userInfo; ++ (NSError *)sdl_fileManager_unableToDelete_ErrorWithUserInfo:(NSDictionary *)userInfo; + (NSError *)sdl_fileManager_fileDoesNotExistError; + (NSError *)sdl_fileManager_fileUploadCanceled; diff --git a/SmartDeviceLink/SDLError.m b/SmartDeviceLink/SDLError.m index 1dc6c26fc..44fe9ac16 100644 --- a/SmartDeviceLink/SDLError.m +++ b/SmartDeviceLink/SDLError.m @@ -140,8 +140,12 @@ SDLErrorDomain *const SDLErrorDomainFileManager = @"com.sdl.filemanager.error"; return [NSError errorWithDomain:SDLErrorDomainFileManager code:SDLFileManagerErrorUnableToUpload userInfo:userInfo]; } -+ (NSError *)sdl_fileManager_unableTo__ErrorWithUserInfo:(NSDictionary *)userInfo { - return [NSError errorWithDomain:SDLErrorDomainFileManager code:SDLFileManagerMultipleFileTasksFailed userInfo:userInfo]; ++ (NSError *)sdl_fileManager_unableToUpload_ErrorWithUserInfo:(NSDictionary *)userInfo { + return [NSError errorWithDomain:SDLErrorDomainFileManager code:SDLFileManagerMultipleFileUploadTasksFailed userInfo:userInfo]; +} + ++ (NSError *)sdl_fileManager_unableToDelete_ErrorWithUserInfo:(NSDictionary *)userInfo { + return [NSError errorWithDomain:SDLErrorDomainFileManager code:SDLFileManagerMultipleFileDeleteTasksFailed userInfo:userInfo]; } + (NSError *)sdl_fileManager_fileUploadCanceled { diff --git a/SmartDeviceLink/SDLErrorConstants.h b/SmartDeviceLink/SDLErrorConstants.h index b15e360ba..e3d473109 100644 --- a/SmartDeviceLink/SDLErrorConstants.h +++ b/SmartDeviceLink/SDLErrorConstants.h @@ -73,5 +73,9 @@ typedef NS_ENUM(NSInteger, SDLFileManagerError) { /* * One or more of multiple files being uploaded or deleted failed. */ - SDLFileManagerMultipleFileTasksFailed = -7, + SDLFileManagerMultipleFileUploadTasksFailed = -7, + /* + * One or more of multiple files being uploaded or deleted failed. + */ + SDLFileManagerMultipleFileDeleteTasksFailed = -8, }; diff --git a/SmartDeviceLink/SDLFileManager.m b/SmartDeviceLink/SDLFileManager.m index 8dfd56ea3..a74faf046 100644 --- a/SmartDeviceLink/SDLFileManager.m +++ b/SmartDeviceLink/SDLFileManager.m @@ -240,7 +240,7 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError"; dispatch_group_notify(deleteFilesTask, dispatch_get_main_queue(), ^{ if (completionHandler == nil) { return; } if (failedDeletes.count > 0) { - return completionHandler([NSError sdl_fileManager_unableTo__ErrorWithUserInfo:failedDeletes]); + return completionHandler([NSError sdl_fileManager_unableToDelete_ErrorWithUserInfo:failedDeletes]); } return completionHandler(nil); }); @@ -298,7 +298,7 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError"; dispatch_group_notify(uploadFilesTask, dispatch_get_main_queue(), ^{ if (completionHandler == nil) { return; } if (failedUploads.count > 0) { - return completionHandler([NSError sdl_fileManager_unableTo__ErrorWithUserInfo:failedUploads]); + return completionHandler([NSError sdl_fileManager_unableToUpload_ErrorWithUserInfo:failedUploads]); } return completionHandler(nil); }); diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m index 6ce3132e3..42e7e2d75 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m @@ -641,7 +641,7 @@ describe(@"SDLFileManager uploading/deleting multiple files", ^{ } testConnectionManager.responses = testConnectionManagerResponses; - expectedError = [NSError sdl_fileManager_unableTo__ErrorWithUserInfo:expectedFailedUploads]; + expectedError = [NSError sdl_fileManager_unableToUpload_ErrorWithUserInfo:expectedFailedUploads]; expectedSpaceLeft = @(testSpaceAvailable); }); }); @@ -737,14 +737,14 @@ describe(@"SDLFileManager uploading/deleting multiple files", ^{ testFileCount = 11; testCancelIndex = 0; testFileNameBase = @"TestUploadFilesCancelAfterFirst"; - expectedError = [NSError sdl_fileManager_unableTo__ErrorWithUserInfo:testResponses]; + expectedError = [NSError sdl_fileManager_unableToUpload_ErrorWithUserInfo:testResponses]; }); it(@"should cancel the remaining files if cancel is triggered after half of the files are uploaded", ^{ testFileCount = 30; testCancelIndex = testFileCount / 2; testFileNameBase = @"TestUploadFilesCancelInMiddle"; - expectedError = [NSError sdl_fileManager_unableTo__ErrorWithUserInfo:testResponses]; + expectedError = [NSError sdl_fileManager_unableToUpload_ErrorWithUserInfo:testResponses]; }); it(@"should not fail if there are no more files to cancel", ^{ @@ -783,7 +783,7 @@ describe(@"SDLFileManager uploading/deleting multiple files", ^{ return YES; } completionHandler:^(NSError * _Nullable error) { if (expectedError != nil) { - expect(error.code).to(equal(SDLFileManagerMultipleFileTasksFailed)); + expect(error.code).to(equal(SDLFileManagerMultipleFileUploadTasksFailed)); } else { expect(error).to(beNil()); } @@ -819,7 +819,7 @@ describe(@"SDLFileManager uploading/deleting multiple files", ^{ testFileCount = 11; testCancelIndex = 0; testFileNameBase = @"TestUploadFilesCancelGroupOnly"; - expectedError = [NSError sdl_fileManager_unableTo__ErrorWithUserInfo:testResponses]; + expectedError = [NSError sdl_fileManager_unableToUpload_ErrorWithUserInfo:testResponses]; testOtherFileNameBase = @"TestOtherUploadFilesCancelGroupOnly"; testOtherFileCount = 22; @@ -878,7 +878,7 @@ describe(@"SDLFileManager uploading/deleting multiple files", ^{ return YES; } completionHandler:^(NSError * _Nullable error) { if (expectedError != nil) { - expect(error.code).to(equal(SDLFileManagerMultipleFileTasksFailed)); + expect(error.code).to(equal(SDLFileManagerMultipleFileUploadTasksFailed)); } else { expect(error).to(beNil()); } @@ -1029,7 +1029,7 @@ describe(@"SDLFileManager uploading/deleting multiple files", ^{ } testConnectionManager.responses = testConnectionManagerResponses; - expectedError = [NSError sdl_fileManager_unableTo__ErrorWithUserInfo:expectedFailedDeletes]; + expectedError = [NSError sdl_fileManager_unableToDelete_ErrorWithUserInfo:expectedFailedDeletes]; expectedSpaceLeft = @(testSpaceAvailable); }); }); |