The Perl Toolchain Summit 2025 Needs You: You can help 🙏 Learn more

=head1 NAME
Protocol::HTTP::Error - HTTP parser error constants
=head1 SYNOPSIS
use Protocol::HTTP;
my ($request, $state, $position, $error) = $parser->parse($str);
if ($error and $error == Protocol::HTTP::Error::body_too_large) { ... }
=head1 DESCRIPTION
Constants provided by this package are returned by parsers to signal about http protocol errors.
All errors are L<XS::STL::ErrorCode> objects and are of category C<Protocol::HTTP::error_category>.
Protocol::HTTP::Error::body_too_large->category() == Protocol::HTTP::error_category; # true
=head1 CONSTANTS
=head2 lexical_error
http protocol generic error
=head2 multiple_content_length
multiple headers "Content-Length"
=head2 headers_too_large
http headers exceeded maximum configured value
=head2 body_too_large
message body (plain or in chunks) exceeded maximum configured value
=head2 unexpected_body
Body arrived for a message that is not supposed to have a body
=head2 unexpected_eof
EOF arrived for a message that should not end right now
=head2 unexpected_continue
"100 continue" code arrived from server while it was not supposed to send that
=head2 unsupported_transfer_encoding
=head2 unsupported_compression
=head2 uncompression_failure
=head1 SEE ALSO
L<Protocol::HTTP>
=cut