From 5e5c8947d8dd66bd33d584ec7833e3958231bf8a Mon Sep 17 00:00:00 2001 From: Jacob Moura Date: Wed, 7 Sep 2022 17:21:25 -0300 Subject: [PATCH] throw binary error --- bin/src/commands/generate_command.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/src/commands/generate_command.dart b/bin/src/commands/generate_command.dart index 2cf927ac..6ee63a7b 100644 --- a/bin/src/commands/generate_command.dart +++ b/bin/src/commands/generate_command.dart @@ -59,6 +59,12 @@ class GenerateCommand extends Command { }, ); + // throw error + if (configProcessResult.exitCode > 0) { + final json = jsonDecode(configProcessResult.stderr); + throw json['message']; + } + // Parse config result. final GetConfigResult configResult = GetConfigResult.fromJson( jsonDecode(configProcessResult.stdout as String) as Map,