devo-ps/pipelines

`Bash` type bug

guinan34 opened this issue · 1 comments

when using Bash type in pipeline as an action task. if the shell returned an exit code . such as 3 or 4 or others. the pipeline will returned an error as below first screenshot shown .
i checked the source code found the the bash module exception handle section has some issues need to fix.

image

image

https://github.com/amoffat/sh/blob/1.14.2/sh.py#L337-L399
as you can see, ErrorReturnCode only has full_cmd/stdout/stderr/truncate properties. it should use str(e) here.

and e.exit_code do exist when the exception is an instance of ErrorReturnCode_${exit_code} like ErrorReturnCode_4 in this case.

I think it will be a easy fix.