=head1 NAME

UniEvent::Error - UniEvent error constants



=head1 DESCRIPTION

This package contains all generic UniEvent error constants.

Also objects of class C<UniEvent::Error> can be thrown in case of critical malfunction.



=head1 SYNOPSIS

    $tcp->connect($host, $port);
    $tcp->connect_callback(sub {
        my ($tcp, $err) = @_;
        if ($err) {
            if    ($err == UE::Error::ssl_error)     { ... }
            elsif ($err == UE::Error::resolve_error) { ... }
            ...
        }
    });



=head1 CONSTANTS


=head2 ERROR CATEGORIES

These constants hold various error categories used by UniEvent, as L<XS::STL::ErrorCategory> objects.

=head3 category

Generic unievent errors category. All possible errors for this category are listed in this package, see below.

=head3 system_category

An alias for C<XS::STL::ErrorCode::system_category>, a standard system error category. All possible errors for this category are listed in
C<XS::STL::errc> package, see L<XS::STL::ErrorCode>.

=head3 resolve_category

DNS resolver error category. All possible errors for this category are listed in L<UniEvent::ResolveError>.

=head3 ssl_category

SSL and TLS error category (high-level errors). These are returned from SSL library.

=head3 openssl_category

Low level openssl library errors. These are returned from SSL library.

=head3 streamer_category

Streamer error category (L<UniEvent::Streamer>). All possible errors for this category are listed in L<UniEvent::StreamerError>.


=head2 GENERIC UNIEVENT ERRORS

These are possible errors for generic unievent category (UniEvent::Error::category())

=head3 unknown_error

=head3 read_start_error

=head3 ssl_error

=head3 resolve_error

=head3 ai_address_family_not_supported

=head3 ai_temporary_failure

=head3 ai_bad_flags

=head3 ai_bad_hints

=head3 ai_request_canceled

=head3 ai_permanent_failure

=head3 ai_family_not_supported

=head3 ai_out_of_memory

=head3 ai_no_address

=head3 ai_unknown_node_or_service

=head3 ai_argument_buffer_overflow

=head3 ai_resolved_protocol_unknown

=head3 ai_service_not_available_for_socket_type

=head3 ai_socket_type_not_supported

=head3 invalid_unicode_character

=head3 not_on_network

=head3 transport_endpoint_shutdown

=head3 host_down

=head3 remote_io



=head1 METHODS

Methods of C<UniEvent::Error> objects which may be thrown in case of critical errors.

=head2 new($string)

=head2 new($error_code)

Constructs new Error object either from textual description or from L<XS::ErrorCode> object.


=head2 what()

Returns human-readable description of the error


=head2 clone()

Clones the error

=cut
