Net::OpenSocial::Client::ErrorHandler - Error handler role
package MyClass; use Any::Moose; with 'Net::OpenSocial::Client::ErrorHandler'; sub my_method { my $self = shift; if ( $self->found_any_error ) { return $self->ERROR('Error occured.'); } return 1; } package main; use MyClass; my $foo = MyClass->new; my $result = $foo->my_method or die $foo->errstr;
Error handler role. This provides a simple way to handle error.
When some error occured, call like that
return $self->ERROR($error_message);
And this returns undef. After that, you can pick up the error message by calling 'errstr' method.
If it already called 'ERROR' method, it returns an error message.
die $self->errstr;
Class::ErrorHandler
Lyo Kato, <lyo.kato@gmail.com>
Copyright (C) 2009 by Lyo Kato
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Net::OpenSocial::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::OpenSocial::Client
CPAN shell
perl -MCPAN -e shell install Net::OpenSocial::Client
For more information on module installation, please visit the detailed CPAN module installation guide.