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

child process prints pipeline failure messages, even when wrapped by try (verbose_errexit) #1907

Open
glyh opened this issue Apr 6, 2024 · 1 comment
Labels

Comments

@glyh
Copy link
Collaborator

glyh commented Apr 6, 2024

{
  try {
    ps | grep python
  }
  if (_status === 0) {
    echo 'found'
  } else {
    echo 'not found'
  }
}
      ps | grep python
           ^~~~
./a.ysh:3: errexit PID 146323: command.Simple failed with status 1
yeah
@glyh glyh changed the title Failing pipeline is not captured by try [BUG] Failing pipeline is not captured by try Apr 6, 2024
@glyh glyh added the bug label Apr 6, 2024
@andychu
Copy link
Contributor

andychu commented Apr 8, 2024

OK interesting, the error is from the child process. The main process runs try, and continues.

I think this is an issue with shopt --set verbose_errexit

$ try { echo hi | grep z }; echo 'continue here'
  try { echo hi | grep z }; echo 'continue here'
                  ^~~~
[ interactive ]:18: errexit PID 27515: command.Simple failed with status 1
continue here

@andychu andychu changed the title [BUG] Failing pipeline is not captured by try child process prints pipeline failure messages, even when wrapped by try (verbose_errexit) Apr 8, 2024
@andychu andychu removed the bug label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants