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
Why doesn't Perl 6's try handle a non-zero exit in shell()? #6172
Comments
From @briandfoyI originally asked about this on Stackoverflow This `try` catches the exception: try die X::AdHoc; The output shows that the program continues: Got to the end If I attempt it with `shell` and a command that doesn't exit with 0, try shell('/usr/bin/false'); The output doesn't look like an exception: The spawned command '/usr/bin/false' exited unsuccessfully (exit code: 1) What's going on that this makes it through the `try`? --- Perl variables --- --- Other Environment --- -- |
From @zoffixznetOn Tue, 04 Apr 2017 02:52:53 -0700, comdog wrote:
Thank you for the report. However, there's no bug here. try catches exceptions. shell() doesn't throw, but returns a Proc object. So in your code, the try gives a Proc object a pass, it immediately gets sunk, and explodes (outside of try). You can use `try sink shell '/usr/bin/false'` to get it to explode inside of try. We also have a support channel where you can ask questions like this one: https://webchat.freenode.net/?channels=#perl6 |
The RT System itself - Status changed from 'new' to 'open' |
@zoffixznet - Status changed from 'open' to 'rejected' |
From @lizmatThanks for reporting! Turns out this isn’t actually a bug, but the way shell() works. As Jonathan explained at: https://irclog.perlgeek.de/perl6-dev/2017-04-04#i_14372945 the shell() function returns a Proc object. This only throws the shelling out failed and the Proc object is sunk. So ENOTABUG.
|
From @AlexDanielFWIW, another place where this was discussed: https://rt.perl.org/Public/Bug/Display.html?id=130715
|
Migrated from rt.perl.org#131097 (status was 'rejected')
Searchable as RT131097$
The text was updated successfully, but these errors were encountered: