Skip to content
Browse files

avoid raising exceptions

  • Loading branch information...
1 parent 8a1d79c commit 347f788f990fca429a6dde61e8b3b4278fe7efff @neilrahilly neilrahilly committed Oct 11, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 Mixpanel/Mixpanel.m
View
9 Mixpanel/Mixpanel.m
@@ -235,15 +235,18 @@ + (id)sharedInstanceWithToken:(NSString *)apiToken
+ (id)sharedInstance
{
if (sharedInstance == nil) {
- [NSException raise:@"MixpanelInitializationException" format:@"sharedInstanceWithToken: must be called before sharedInstance can be used"];
+ NSLog(@"%@ warning sharedInstance called before sharedInstanceWithToken:", self);
}
return sharedInstance;
}
- (id)initWithToken:(NSString *)apiToken andFlushInterval:(NSUInteger)flushInterval
{
- if (apiToken == nil || [apiToken length] == 0) {
- [NSException raise:@"MixpanelAPITokenException" format:@"mixpanel api token must be a non-empty string. find yours at https://mixpanel.com/account/"];
+ if (apiToken == nil) {
+ apiToken = @"";
+ }
+ if ([apiToken length] == 0) {
+ NSLog(@"%@ warning empty api token", self);
}
if (self = [self init]) {
self.people = [[[MixpanelPeople alloc] initWithMixpanel:self] autorelease];

0 comments on commit 347f788

Please sign in to comment.
Something went wrong with that request. Please try again.