IPC::Open3::Callback::CommandFailedException - An exception thrown when run_or_die encounters a failed command
version 1.14
use IPC::Open3::Callback::CommandRunner; my $runner = IPC::Open3::Callback::CommandRunner->new(); eval { $runner->run_or_die( 'echo Hello World' ); }; if ( $@ && ref( $@ ) eq 'IPC::Open3::Callback::CommandFailedException' ) { # gather info my $command = $@->get_command(); # an arrayref my $exit_status = $@->get_exit_status(); my $out = $@->get_out(); my $err = $@->get_err(); # or just print print( "$@\n" ); # includes all info }
This provides a container for information obtained when a command fails. The command and exit_status will always be available, but out and err will only be present if you supply the command option out_buffer => 1 and err_buffer => 1 respectively.
command
exit_status
out
err
out_buffer => 1
err_buffer => 1
Returns a reference to the array supplied as the command to command runner.
Returns the exit status from the attempt to run the command.
Returns the text written to STDOUT by the command. Only present if out_buffer was requested as a command runner option.
STDOUT
out_buffer
Returns the text written to STDERR by the command. Only present if err_buffer was requested as a command runner option.
STDERR
err_buffer
Returns a string representation of all of the attributes. The qw{""} operator is overridden to call this method.
qw{""}
Lucas Theisen <lucastheisen@pastdev.com>
Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>
This software is copyright (c) 2013 by Lucas Theisen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Please see those modules/websites for more information related to this module.
IPC::Open3::Callback
IPC::Open3::Callback::CommandRunner
https://github.com/lucastheisen/ipc-open3-callback
To install IPC::Open3::Callback, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IPC::Open3::Callback
CPAN shell
perl -MCPAN -e shell install IPC::Open3::Callback
For more information on module installation, please visit the detailed CPAN module installation guide.