From 6751dc0882ac1e7206342803f15fed99634950d2 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sat, 27 May 2017 15:27:22 +0100 Subject: [PATCH] [ios] removed unused errors module --- ios/RNFirebase/RNFirebaseErrors.h | 23 -------------- ios/RNFirebase/RNFirebaseErrors.m | 52 ------------------------------- 2 files changed, 75 deletions(-) delete mode 100644 ios/RNFirebase/RNFirebaseErrors.h delete mode 100644 ios/RNFirebase/RNFirebaseErrors.m diff --git a/ios/RNFirebase/RNFirebaseErrors.h b/ios/RNFirebase/RNFirebaseErrors.h deleted file mode 100644 index bf61e8ea..00000000 --- a/ios/RNFirebase/RNFirebaseErrors.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef RNFirebaseErrors_h -#define RNFirebaseErrors_h - -#if __has_include() -#import -#else // Compatibility for RN version < 0.40 -#import "RCTBridgeModule.h" -#endif -#import "Firebase.h" - -@interface RNFirebaseErrors : NSObject { - -} - -+ (void) handleException:(NSException *)exception - withCallback:(RCTResponseSenderBlock)callback; - -+ (NSDictionary *) handleFirebaseError:(NSString *) name - error:(NSError *) error - withUser:(FIRUser *) user; -@end - -#endif diff --git a/ios/RNFirebase/RNFirebaseErrors.m b/ios/RNFirebase/RNFirebaseErrors.m deleted file mode 100644 index 856f682d..00000000 --- a/ios/RNFirebase/RNFirebaseErrors.m +++ /dev/null @@ -1,52 +0,0 @@ -#import "RNFirebaseErrors.h" - -@implementation RNFirebaseErrors - -RCT_EXPORT_MODULE(RNFirebaseErrors); - -+ (void) handleException:(NSException *)exception - withCallback:(RCTResponseSenderBlock)callback -{ - NSString *errDesc = [exception description]; - NSLog(@"An error occurred: %@", errDesc); - // No user is signed in. - NSDictionary *err = @{ - @"error": @"No user signed in", - @"description": errDesc - }; - callback(@[err]); -} - -+ (NSDictionary *) handleFirebaseError:(NSString *) name - error:(NSError *) error - withUser:(FIRUser *) user -{ - NSMutableDictionary *err = [NSMutableDictionary dictionaryWithObjectsAndKeys: - name, @"name", - @([error code]), @"code", - [error localizedDescription], @"rawDescription", - [[error userInfo] description], @"userInfo", - nil]; - - NSString *description = @"Unknown error"; - switch (error.code) { - case FIRAuthErrorCodeInvalidEmail: - description = @"Invalid email"; - break; - case FIRAuthErrorCodeUserNotFound: - description = @"User not found"; - break; - case FIRAuthErrorCodeNetworkError: - description = @"Network error"; - break; - case FIRAuthErrorCodeInternalError: - description = @"Internal error"; - break; - default: - break; - } - [err setValue:description forKey:@"description"]; - return [NSDictionary dictionaryWithDictionary:err]; -} - -@end