[build] Report the exit code for failed build-time executions.

Bug: https://github.com/dart-lang/sdk/issues/56529
Change-Id: Idc0e41091491b144c12056dca2eb441444c2af0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384400
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
diff --git a/build/gn_run_binary.py b/build/gn_run_binary.py
index 99cd20c..26dc769 100755
--- a/build/gn_run_binary.py
+++ b/build/gn_run_binary.py
@@ -24,8 +24,8 @@
         subprocess.check_output(command, stderr=subprocess.STDOUT)
         return 0
     except subprocess.CalledProcessError as e:
-        return ("Command failed: " + ' '.join(command) + "\n" + "output: " +
-                _decode(e.output))
+        return ("Command failed: " + ' '.join(command) + "\n" + "exitCode: " +
+                str(e.returncode) + "\n" + "output: " + _decode(e.output))
     except OSError as e:
         return ("Command failed: " + ' '.join(command) + "\n" + "output: " +
                 _decode(e.strerror))