Facebook::Graph::Exception - The exceptions thrown by this module.
version 1.0200
Facebook::Graph throws exceptions when it encounters a problem. All exceptions are derived from Exception::Class.
If you don't plan on using exceptions to trap problems, you can very easily just trap them like a normal die like this:
die
eval { $fb->do_something }; if ($@) { say "An error occurred with the following message: ". $@; }
A general purpose exception. No special methods. Example:
eval { $fb->do_something } my $e; if ($e = Exception::Class->caught('Facebook::Graph::Exception::General')) { warn $e->error; exit; }
An exception that is thrown communicating with Facebook. It has several extra methods.
eval { $fb->do_something } my $e; if ($e = Exception::Class->caught('Facebook::Graph::Exception::RPC')) { warn $e->error; warn $e->http_code; warn $e->http_message; warn $e->facebook_message; warn $e->facebook_type; warn $e->uri exit; }
The HTTP status code can be used to help figure out what went wrong: Example: 401.
401
The HTTP status message usually isn't all that useful, but in case you need it, here it is. Example: Authorization Required.
Authorization Required
Facebook will return an error message to help you diagnose what is wrong with your request, which can sometimes be useful. Example: Error validating application.
Error validating application.
Facebook returns various exception types that can sometimes be helpful in diagnosing problems. Example: OAuthException.
OAuthException
The URI used to request information from Facebook. In the case of a GET this can be very useful. Not so useful on a POST.
Facebook::Graph is Copyright 2010 Plain Black Corporation (http://www.plainblack.com) and is licensed under the same terms as Perl itself.
To install Facebook::Graph, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Facebook::Graph
CPAN shell
perl -MCPAN -e shell install Facebook::Graph
For more information on module installation, please visit the detailed CPAN module installation guide.