Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use error output as TaskExitException message #1157

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

prudloff-insite
Copy link
Contributor

Overview

This pull request:

  • Fixes a bug
  • Adds a feature
  • Breaks backwards compatibility
  • Has tests that cover changes
  • Adds or fixes documentation

Summary

Fixes #1153.

Description

TaskExitException contains STDOUT, which causes the stand output to be displayed twice and the actual error message to be buried between it.
Making the exception contain STDERR ensure the error message is the last thing printed, so the can find it easily. (It also makes more sense semantically that an exit exception contains the error output.)

With the patch

 [ExecStack] echo "this command output is very long" && echo "this command output is very long" && echo "this command output is very long" && echo "this command output is very long" && echo "this command output is very long" && echo "this command output is very long" && invalid_cmd
 [ExecStack] Running echo "this command output is very long" &&
 echo "this command output is very long" &&
 echo "this command output is very long" &&
 echo "this command output is very long" &&
 echo "this command output is very long" &&
 echo "this command output is very long" &&
 invalid_cmd
this command output is very long
this command output is very long
this command output is very long
this command output is very long
this command output is very long
this command output is very long
sh: 1: invalid_cmd: not found
 [ExecStack]  Exit code 127  Time 0.003s
 [notice] Stopping on fail. Exiting....
 [error]  Exit Code: 127 
 [error]    in task Robo\Task\Base\ExecStack 

  sh: 1: invalid_cmd: not found
 

Without the patch

 [ExecStack] echo "this command output is very long" && echo "this command output is very long" && echo "this command output is very long" && echo "this command output is very long" && echo "this command output is very long" && echo "this command output is very long" && invalid_cmd
 [ExecStack] Running echo "this command output is very long" &&
 echo "this command output is very long" &&
 echo "this command output is very long" &&
 echo "this command output is very long" &&
 echo "this command output is very long" &&
 echo "this command output is very long" &&
 invalid_cmd
this command output is very long
this command output is very long
this command output is very long
this command output is very long
this command output is very long
this command output is very long
sh: 1: invalid_cmd: not found
 [ExecStack]  Exit code 127  Time 0.003s
 [notice] Stopping on fail. Exiting....
 [error]  Exit Code: 127 
 [error]    in task Robo\Task\Base\ExecStack 

  this command output is very long
this command output is very long
this command output is very long
this command output is very long
this command output is very long
this command output is very long
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TaskExitException should contain the error output
1 participant