Skip to content

Commit 4c6d71b

Browse files
committed
Refactoring of error constant names to be closer to what they actually mean.
1 parent 4f1ef60 commit 4c6d71b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cocos2d/CCPackageConstants.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Errors
22
extern NSUInteger const PACKAGE_ERROR_DOWNLOAD_SERVER_RESPONSE_NOT_OK;
33

4-
extern NSUInteger const PACKAGE_ERROR_INSTALL_PACKAGE_NOT_FOUND;
4+
extern NSUInteger const PACKAGE_ERROR_INSTALL_UNZIPPED_PACKAGE_NOT_FOUND;
55

6-
extern NSUInteger const PACKAGE_ERROR_INSTALL_COULD_NOT_MOVE_PACKAGE;
6+
extern NSUInteger const PACKAGE_ERROR_INSTALL_COULD_NOT_MOVE_PACKAGE_TO_INSTALL_FOLDER;
77

88
extern NSUInteger const PACKAGE_ERROR_INSTALL_PACKAGE_EMPTY;
99

cocos2d/CCPackageConstants.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// Errors
55
NSUInteger const PACKAGE_ERROR_DOWNLOAD_SERVER_RESPONSE_NOT_OK = 10000;
66

7-
NSUInteger const PACKAGE_ERROR_INSTALL_PACKAGE_NOT_FOUND = 10010;
7+
NSUInteger const PACKAGE_ERROR_INSTALL_UNZIPPED_PACKAGE_NOT_FOUND = 10010;
88

9-
NSUInteger const PACKAGE_ERROR_INSTALL_COULD_NOT_MOVE_PACKAGE = 10011;
9+
NSUInteger const PACKAGE_ERROR_INSTALL_COULD_NOT_MOVE_PACKAGE_TO_INSTALL_FOLDER = 10011;
1010

1111
NSUInteger const PACKAGE_ERROR_INSTALL_PACKAGE_EMPTY = 10012;
1212

cocos2d/CCPackageInstaller.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ - (BOOL)installWithError:(NSError **)error
3939
NSAssert(installData != nil, @"installData must not be nil");
4040
NSAssert(installData.unzipURL != nil, @"installData.unzipURL must not be nil");
4141

42-
if (![self packageExists:error])
42+
if (![self unzippedPackageFolderExists:error])
4343
{
4444
[_package setValue:@(CCPackageStatusInstallationFailed) forKey:@"status"];
4545
return NO;
@@ -88,7 +88,7 @@ - (BOOL)movePackageToInstallPathWithError:(NSError **)error
8888
[_package setValue:nil forKey:@"installURL"];
8989

9090
[self setNewError:error
91-
code:PACKAGE_ERROR_INSTALL_COULD_NOT_MOVE_PACKAGE
91+
code:PACKAGE_ERROR_INSTALL_COULD_NOT_MOVE_PACKAGE_TO_INSTALL_FOLDER
9292
message:[NSString stringWithFormat:@"Could not move package to install path \"%@\", underlying error: %@", _installPath, errorMove]
9393
underlyingError:errorMove];
9494

@@ -100,7 +100,7 @@ - (BOOL)movePackageToInstallPathWithError:(NSError **)error
100100
return YES;
101101
}
102102

103-
- (BOOL)packageExists:(NSError **)error
103+
- (BOOL)unzippedPackageFolderExists:(NSError **)error
104104
{
105105
CCPackageInstallData *installData = [_package installData];
106106
NSAssert(installData.unzipURL, @"installData.unzipURL must not be nil");
@@ -109,7 +109,7 @@ - (BOOL)packageExists:(NSError **)error
109109
if (![fileManager fileExistsAtPath:installData.unzipURL.path])
110110
{
111111
[self setNewError:error
112-
code:PACKAGE_ERROR_INSTALL_PACKAGE_NOT_FOUND
112+
code:PACKAGE_ERROR_INSTALL_UNZIPPED_PACKAGE_NOT_FOUND
113113
message:[NSString stringWithFormat:@"Package to install not found at path \"%@\"", installData.unzipURL]];
114114

115115
CCLOG(@"[PACKAGE/INSTALL][ERROR] Moving unzipped package to installation folder, package already exists! %@", *error);

0 commit comments

Comments
 (0)