File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -472,7 +472,20 @@ - (id)loadRequest:(NSURLRequest *)request
472472 }
473473 request = [NSURLRequest requestWithURL: url];
474474 }
475- return [(WKWebView *)_engineWebView loadRequest: request];
475+ if ([self .webServer isRunning ]) {
476+ return [(WKWebView *)_engineWebView loadRequest: request];
477+ } else {
478+ NSString * errorHtml = [NSString stringWithFormat:
479+ @" <html>"
480+ @" <head><title>Error</title></head>"
481+ @" <div style='font-size:2em'>"
482+ @" <p>The App Server is not running.</p>"
483+ @" <p>Close other apps and try again.</p>"
484+ @" </div>"
485+ @" </html>"
486+ ];
487+ return [self loadHTMLString: errorHtml baseURL: request.URL];
488+ }
476489}
477490
478491- (id )loadHTMLString : (NSString *)string baseURL : (NSURL *)baseURL
You can’t perform that action at this time.
0 commit comments