-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Capture
stdout
and stderr
even if cmd.Run
fails
In its current form, if `cmd.Run` fails, then the function immediately exits with no reason given for the termination. This makes debugging scripts hard to understand as no indication is given for the failure, other than a failure occured. By trapping the error returned from `cmd.Run`, we first process the buffers for both `stdout` and `stderr` and set these to the `dxr`. Additionally we capture a truncated `stderr` from the command error which can help point to where the command failed, setting this as the Fatal error message returned as an event. Signed-off-by: Martin Proffitt <mproffitt@choclab.net>
- Loading branch information
Showing
2 changed files
with
79 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters