mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-09 20:25:15 +08:00
20 lines
563 B
Objective-C
20 lines
563 B
Objective-C
#import "CodePush.h"
|
|
|
|
@implementation CodePushErrorUtils
|
|
|
|
static NSString *const CodePushErrorDomain = @"CodePushError";
|
|
static const int CodePushErrorCode = -1;
|
|
|
|
+ (NSError *)errorWithMessage:(NSString *)errorMessage
|
|
{
|
|
return [NSError errorWithDomain:CodePushErrorDomain
|
|
code:CodePushErrorCode
|
|
userInfo:@{ NSLocalizedDescriptionKey: NSLocalizedString(errorMessage, nil) }];
|
|
}
|
|
|
|
+ (BOOL)isCodePushError:(NSError *)err
|
|
{
|
|
return err != nil && [CodePushErrorDomain isEqualToString:err.domain];
|
|
}
|
|
|
|
@end |