Mojo::WebService::Twitter::Error - Container for API errors
my $error = Mojo::WebService::Twitter::Error->new->from_tx($tx); warn "$_->{code}: $_->{message}\n" for @{$error->api_errors}; die $error->to_string;
Mojo::WebService::Twitter::Error is a container for API errors received from the Twitter API via Mojo::WebService::Twitter.
Mojo::WebService::Twitter::Error exports the following functions on demand.
my $error = twitter_tx_error($tx);
Creates a new Mojo::WebService::Twitter::Error and populates it using "from_tx".
Mojo::WebService::Twitter::Error implements the following attributes.
my $errors = $error->api_errors; $error = $error->api_errors([{code => 215, message => 'Bad Authentication data.'}]);
Arrayref of error codes and messages received from the Twitter API.
my $message = $error->connection_error; $error = $error->connection_error('Inactivity timeout');
Connection error if any.
my $status = $error->http_status; $error = $error->http_status(404);
HTTP status code returned by Twitter API.
my $message = $error->http_message; $error = $error->http_message('Not Found');
HTTP status message returned by Twitter API.
Mojo::WebService::Twitter::Error inherits all methods from Mojo::Base, and implements the following new ones.
$error = $error->from_tx($tx);
Load connection, API, and HTTP error data from transaction.
my $string = $error->to_string;
String representation of connection, API, or HTTP error.
Mojo::WebService::Twitter::Error overloads the following operators.
Always true.
Alias for "to_string".
Report any issues on the public bugtracker.
Dan Book <dbook@cpan.org>
This software is Copyright (c) 2015 by Dan Book.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
Mojo::WebService::Twitter
To install Mojo::WebService::Twitter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojo::WebService::Twitter
CPAN shell
perl -MCPAN -e shell install Mojo::WebService::Twitter
For more information on module installation, please visit the detailed CPAN module installation guide.