3 ms·
Doesn't the snippet above hide the errors and warnings (since I do not see any code to print them)? Does not seem very ergonimic to me.
by theamk 3y ago
Doesn't the snippet above hide the errors and warnings (since I do not see any code to print them)?
Does not seem very ergonimic to me.
- yeti-sh 3y agoNo it does not, in fact; errors or warnings will pop up as an unhandled exception and print: - command actually executed, - snippet of stdout - and snippet of stderr. They can be handled using standard exception techniques.
- theamk 3y agoIsn't that only for failed commands? so if command succeeds with warnings, or if if fails, but the retries and passed, ghen you get no output.
- yeti-sh 3y agoThe exception is raised if the command returns a non-zero error code. If it returns a zero error code then the return value of, say, compose.up() contains the command's stdout. In addition stdout can be redirected to a file, or to another command, or to a callable, — which will be called for chunks of stdout while the command is in operation.