From fc472d043e81c2b5687a0f83dbbdd0dd02b73e35 Mon Sep 17 00:00:00 2001 From: Kelly Campbell Date: Mon, 11 Sep 2017 17:13:15 -0400 Subject: [PATCH] Add error output to exec error messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e.g. for an error like "env: ‘node’: No such file or directory" the sublime console was only reporting "exited with code 127" which wasn't very helpful in determining the cause. --- flowtype/commands/exec_flow.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flowtype/commands/exec_flow.py b/flowtype/commands/exec_flow.py index c8eb22e..705507c 100644 --- a/flowtype/commands/exec_flow.py +++ b/flowtype/commands/exec_flow.py @@ -46,5 +46,9 @@ def run(self): os.close(read) except subprocess.CalledProcessError as err: - self.stderr = str(err) + if type(err.output) is bytes: + output = err.output.decode('utf-8') + else: + output = err.output + self.stderr = str(err) + ': ' + str(output) self.returncode = 1