diff --git a/packages/flutter_tools/lib/src/commands/daemon.dart b/packages/flutter_tools/lib/src/commands/daemon.dart index e9dc937e3c..820507ba89 100644 --- a/packages/flutter_tools/lib/src/commands/daemon.dart +++ b/packages/flutter_tools/lib/src/commands/daemon.dart @@ -58,8 +58,8 @@ class DaemonCommand extends FlutterCommand { daemonCommand: this, notifyingLogger: notifyingLogger); int code = await daemon.onExit; - if (code != null) - throwToolExit(null, exitCode: code); + if (code != 0) + throwToolExit('Daemon exited with non-zero exit code: $code', exitCode: code); }, onError: _handleError); }