Commit 41d81132 authored by Jakob Andersen's avatar Jakob Andersen Committed by GitHub

Don't print stacktraces from ToolExit errors during flutter run. (#8453)

Instead, actually exit the tool.

Fixes #8363.
parent 2a9fc2e7
...@@ -8,6 +8,7 @@ import 'package:meta/meta.dart'; ...@@ -8,6 +8,7 @@ import 'package:meta/meta.dart';
import 'package:stack_trace/stack_trace.dart'; import 'package:stack_trace/stack_trace.dart';
import 'application_package.dart'; import 'application_package.dart';
import 'base/common.dart';
import 'base/file_system.dart'; import 'base/file_system.dart';
import 'base/utils.dart'; import 'base/utils.dart';
import 'build_info.dart'; import 'build_info.dart';
...@@ -54,6 +55,9 @@ class ColdRunner extends ResidentRunner { ...@@ -54,6 +55,9 @@ class ColdRunner extends ResidentRunner {
shouldBuild: shouldBuild shouldBuild: shouldBuild
); );
}, onError: (dynamic error, StackTrace stackTrace) { }, onError: (dynamic error, StackTrace stackTrace) {
// Actually exit on ToolExit.
if (error is ToolExit)
throw error;
printError('Exception from flutter run: $error', stackTrace); printError('Exception from flutter run: $error', stackTrace);
}); });
} }
......
...@@ -8,6 +8,7 @@ import 'package:meta/meta.dart'; ...@@ -8,6 +8,7 @@ import 'package:meta/meta.dart';
import 'package:stack_trace/stack_trace.dart'; import 'package:stack_trace/stack_trace.dart';
import 'application_package.dart'; import 'application_package.dart';
import 'base/common.dart';
import 'base/context.dart'; import 'base/context.dart';
import 'base/file_system.dart'; import 'base/file_system.dart';
import 'base/logger.dart'; import 'base/logger.dart';
...@@ -81,6 +82,9 @@ class HotRunner extends ResidentRunner { ...@@ -81,6 +82,9 @@ class HotRunner extends ResidentRunner {
shouldBuild: shouldBuild shouldBuild: shouldBuild
); );
}, onError: (dynamic error, StackTrace stackTrace) { }, onError: (dynamic error, StackTrace stackTrace) {
// Actually exit on ToolExit.
if (error is ToolExit)
throw error;
printError('Exception from flutter run: $error', stackTrace); printError('Exception from flutter run: $error', stackTrace);
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment