Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: lib/src/runner/browser/content_shell.dart

Issue 1091883002: More gracefully handle browser errors. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: merge Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/runner/browser/chrome.dart ('k') | lib/src/runner/browser/dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/browser/content_shell.dart
diff --git a/lib/src/runner/browser/content_shell.dart b/lib/src/runner/browser/content_shell.dart
index 2df48c32f4556fc00e457b6eb2158be793f3ea7e..6849e391a8ea83923021718c8d039e76703b04d6 100644
--- a/lib/src/runner/browser/content_shell.dart
+++ b/lib/src/runner/browser/content_shell.dart
@@ -8,6 +8,9 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io';
+import 'package:stack_trace/stack_trace.dart';
+
+import '../../utils.dart';
import '../application_exception.dart';
import 'browser.dart';
@@ -71,9 +74,20 @@ class ContentShell implements Browser {
"latest/dartium/");
}
- if (exitCode != 0) throw "Content shell failed with exit code $exitCode.";
- }).then(_onExitCompleter.complete)
- .catchError(_onExitCompleter.completeError);
+ if (exitCode == 0) return null;
+
+
+ return UTF8.decodeStream(_process.stderr).then((error) {
+ throw new ApplicationException(
+ "Content shell failed with exit code $exitCode:\n$error");
+ });
+ }).then(_onExitCompleter.complete).catchError((error, stackTrace) {
+ if (stackTrace == null) stackTrace = new Trace.current();
+ _onExitCompleter.completeError(
+ new ApplicationException(
+ "Failed to start content shell: ${getErrorMessage(error)}."),
+ stackTrace);
+ });
}
Future close() {
« no previous file with comments | « lib/src/runner/browser/chrome.dart ('k') | lib/src/runner/browser/dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698