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

Unified Diff: pkg/fletchc/lib/src/driver/driver_main.dart

Issue 1345213002: Request bug report if fletch crashes (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: Merged with cee917ffdd0c5be942d6eed129c766c1801ed9b8 Created 5 years, 3 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 | « no previous file | pkg/fletchc/lib/src/fletch_compiler_implementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fletchc/lib/src/driver/driver_main.dart
diff --git a/pkg/fletchc/lib/src/driver/driver_main.dart b/pkg/fletchc/lib/src/driver/driver_main.dart
index 21a5fcf2240b3e59184e1ec7ee3d7b14227441ee..0e853ab34a5e53eea1699a94d1e3b2fbbbceaee6 100644
--- a/pkg/fletchc/lib/src/driver/driver_main.dart
+++ b/pkg/fletchc/lib/src/driver/driver_main.dart
@@ -80,6 +80,10 @@ import 'session_manager.dart' show
import '../verbs/create_verb.dart' show
CreateSessionTask;
+import '../please_report_crash.dart' show
+ crashReportRequested,
+ requestBugReportOnOtherCrashMessage;
+
Function gracefulShutdown;
class DriverCommandTransformerBuilder
@@ -235,6 +239,7 @@ Future<Null> handleVerb(
List<String> arguments,
ClientController client,
IsolatePool pool) async {
+ crashReportRequested = false;
Future<int> performVerb() async {
client.parseArguments(arguments);
@@ -261,6 +266,10 @@ Future<Null> handleVerb(
handleLateError: client.log.error)
.catchError(client.reportErrorToClient, test: (e) => e is InputError)
.catchError((error, StackTrace stackTrace) {
+ if (!crashReportRequested) {
+ client.printLineOnStderr(requestBugReportOnOtherCrashMessage);
+ crashReportRequested = true;
+ }
client.printLineOnStderr('$error');
if (stackTrace != null) {
client.printLineOnStderr('$stackTrace');
@@ -416,6 +425,10 @@ class ClientController {
}
int reportErrorToClient(InputError error, StackTrace stackTrace) {
+ if (!crashReportRequested) {
+ printLineOnStderr(requestBugReportOnOtherCrashMessage);
+ crashReportRequested = true;
+ }
printLineOnStderr(error.asDiagnostic().formatMessage());
if (error.kind == DiagnosticKind.internalError) {
printLineOnStderr('$stackTrace');
@@ -447,6 +460,8 @@ class IsolateController {
/// Subscription for errors from [isolate].
StreamSubscription errorSubscription;
+ bool crashReportRequested = false;
+
IsolateController(this.isolate);
/// Begin a session with the worker isolate.
@@ -474,9 +489,14 @@ class IsolateController {
/// isolate sends DriverCommand.ClosePort, or if the isolate is killed due to
/// DriverCommand.Signal arriving through client.commands.
Future<Null> attachClient(ClientController client) async {
+ crashReportRequested = false;
errorSubscription.onData((errorList) {
String error = errorList[0];
String stackTrace = errorList[1];
+ if (!crashReportRequested) {
+ client.printLineOnStderr(requestBugReportOnOtherCrashMessage);
+ crashReportRequested = true;
+ }
client.printLineOnStderr(error);
if (stackTrace != null) {
client.printLineOnStderr(stackTrace);
« no previous file with comments | « no previous file | pkg/fletchc/lib/src/fletch_compiler_implementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698