POEx::ZMQ::FFI::Role::ErrorChecking
# Used internally by POEx::ZMQ
A Moo::Role consumed by classes comprising the POEx::ZMQ FFI backend.
Errors produced/thrown by these methods are instances of POEx::ZMQ::FFI::Error.
The error handler is a POEx::ZMQ::FFI::Callable instance providing direct access to the zmq_errno(3) and zmq_strerror(3) functions.
Calls zmq_errno(3) to get the errno value for the previous (failed) call.
Used to build a thrown POEx::ZMQ::FFI::Error.
Calls zmq_strerror(3) to get the error string for the current "errno".
An errno can be supplied if one was previously retrieved:
errno
my $errstr = $self->errstr( $errno );
$self->throw_zmq_error( $zmq_function );
Throws a POEx::ZMQ::FFI::Error, unconditionally.
The ZMQ function name is purely informational; "errno" and "errstr" are automatically retrieved for inclusion in the thrown exception object.
$self->throw_if_error( $zmq_function => $call_zmq_ffi_func->(@args) );
Takes a ZMQ function name and a return code from a ZMQ FFI call; calls "throw_zmq_error" if the return code indicates the call failed.
Like "throw_if_error", but warn via "cluck" in Carp rather than throwing an error object.
Returns the invocant if there was no error, else returns false.
Jon Portnoy <avenj@cobaltirc.org>
To install POEx::ZMQ, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POEx::ZMQ
CPAN shell
perl -MCPAN -e shell install POEx::ZMQ
For more information on module installation, please visit the detailed CPAN module installation guide.