Subject: | WWW::Wikipedia croaks() where it should just return an error indicator |
WWW::Wikipedia's search method croaks when it gets an error from calling wikipedias search:
if ( $response->is_success() ) {
my $entry = WWW::Wikipedia::Entry->new( $response->content(), $src );
return( $entry );
} else {
croak( "uhoh, WWW::Wikipedia unable to contact ".$src );
}
I'd prefer it to return undef and just leave it (or get a last_error method) because dieing is not always the wanted thing.
(I'm using it in a small bot which allows users to search wikipedia and when it's down the die messages fload the channel)