NAME
Linux::Event::Error - structured Linux::Event failure details
SYNOPSIS
sub on_error ($stream, $error) {
warn $error->type . ': ' . $error->message . "\n";
warn "system errno " . $error->errno . "\n"
if defined $error->errno;
}
DESCRIPTION
Stream, Listener, Datagram, and Process pass this object to on_error; constructor-time setup failures may throw it. type, operation, errno, and message are the common fields. Other accessors expose context only when it applies to the specific operation.
Errors stringify to a concise diagnostic such as connect: Connection refused (errno=111). Do not parse the string; use the accessors for program logic.
ERROR TYPES
Common type values include io, framing, output_limit, resolve, socket, socket_configuration, connect, timeout, setup, accept, resource, listener, callback, datagram_size, process, process_io, and tls. The list may grow as transports and resource types are added. Code should handle the types it understands and retain a general fallback.
METHODS
type / operation / option / errno / message
Return the common error fields. Fields that do not apply are undefined. option names the socket option when type is socket_configuration.
pending_bytes / pending_datagrams / datagram_size / limit
Return hard output-limit or oversized-packet details. Fields that do not apply to the particular error are undefined.
fatal
True when a Listener failure has made the Listener unusable.
host / port / path / family
Return applicable connection or listener address details.
attempts / resolver_message
Return outbound connection-attempt and resolver details when available.
timeout / deadline
Return the configured relative duration and expired absolute monotonic deadline for established Stream timeout errors. timeout is undefined for an explicit absolute operation deadline and both values are undefined for unrelated error types.
as_string
Return the operation-prefixed diagnostic used by string overloading.
IMMUTABILITY
Linux::Event treats Error objects as immutable values. Their constructor is public for applications that want to report compatible failures, but there are no mutators.