POE::Filter::SimpleHTTP::Error - An error object for SimpleHTTP
version 0.091710
use 5.010; use POE::Filter::SimpleHTTP; use POE::Filter::SimpleHTTP::Error; #exports constants by default
my $filter = POE::Filter::SimpleHTTP->new(); $filter->get_one_start([qw/junk data goes here/]); my $ret = $filter->get_one()->[0];
if($ret->isa('POE::Filter::SimpleHTTP::Error')) { say $ret->error(); # 0 (aka. UNPARSABLE_PREAMBLE); say $ret->context(); # junkdatagoeshere }
This module provides the error class and exported constants for use downstream from the filter to determine what went wrong.
error() contains the actual error code from the filter that corresponds with the exported constants. Suitable for use in numeric comparisons (ie. ==)
If the error has any context associated with it, it will be stored here. Note that some decompression routines do not provide a status message, just return undef, and so there is no context returned.
The data provided doesn't parse for some reason as either a Response or Request. Context provided.
The message contains trailing data that isn't allowed by the RFC. Context provided.
chunked isn't last in the transfer encodings. This isn't allowed by the RFC. Context provided.
Compress::Zlib::inflateInit failed. Context provided.
inflate() failed. Context provided.
uncompress() failed. No context.
memGunzip() failed. No context.
A transfer encoding was not recognized. Context provided.
Copyright 2009 Nicholas Perez. Licensed and distributed under the GPL.
To install POE::Filter::SimpleHTTP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Filter::SimpleHTTP
CPAN shell
perl -MCPAN -e shell install POE::Filter::SimpleHTTP
For more information on module installation, please visit the detailed CPAN module installation guide.