Skip to content

Commit

Permalink
Adds error check for New Restroom web view load fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Harlan Kellaway committed Mar 3, 2015
1 parent ef217bb commit 3821156
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 2 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,21 @@
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "refuge-ios/View/View Controllers/RefugeNewRestroomViewController.m"
timestampString = "447103716.102876"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "49"
endingLineNumber = "49"
landmarkName = "-webView:didFailLoadWithError:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
3 changes: 2 additions & 1 deletion refuge-ios/refuge-ios/Categories/Mixpanel+Refuge.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ typedef NS_ENUM(NSInteger, RefugeMixpanelErrorType)
RefugeMixpanelErrorTypeSearchAttemptFailed,
RefugeMixpanelErrorTypePreloadingRestrooms,
RefugeMixpanelErrorTypeLocalStoreFetchFailed,
RefugeMixpanelErrorTypeOpeningLinkFailed
RefugeMixpanelErrorTypeOpeningLinkFailed,
RefugeMixpanelErrorTypeLoadingNewRestroomWebViewFailed
};

@class RefugeMapPin;
Expand Down
3 changes: 3 additions & 0 deletions refuge-ios/refuge-ios/Categories/Mixpanel+Refuge.m
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ - (NSString *)stringForErrorType:(RefugeMixpanelErrorType)errorType
case RefugeMixpanelErrorTypeOpeningLinkFailed:
return @"Opening Link Failed";
break;
case RefugeMixpanelErrorTypeLoadingNewRestroomWebViewFailed:
return @"Loading New Restroom Web View Failed";
break;
default:
return @"Error Type Not Found";
break;
Expand Down
2 changes: 1 addition & 1 deletion refuge-ios/refuge-ios/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.0.3</string>
<string>1.1.0.4</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSLocationWhenInUseUsageDescription</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import "RefugeNewRestroomViewController.h"

#import "Mixpanel+Refuge.h"

static NSString * const kUrlNewRestroom = @"http://www.refugerestrooms.org/restrooms/new?mobile=true";

@interface RefugeNewRestroomViewController ()
Expand Down Expand Up @@ -46,6 +48,8 @@ - (void)webViewDidFinishLoad:(UIWebView *)webView

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
[[Mixpanel sharedInstance] refugeTrackError:error ofType:RefugeMixpanelErrorTypeLoadingNewRestroomWebViewFailed];

self.loadingView.hidden = YES;
self.errorView.hidden = NO;
}
Expand Down

0 comments on commit 3821156

Please sign in to comment.