The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::GData::Error::Entry - wrap an xml error sent back by Google data APIs v2.

VERSION

0.01

SYNOPSIS

        use WebService::GData::Error;

    #parse an error from a Google data API server...
        my $entry = new WebService::GData::Error::Entry($xmlerror);
        $entry->code;
        $entry->internalreason;
        $entry->domain;
        $entry->location->{type};#this is just a hash
        $entry->location->{content};#this is just a hash

    #create an error from a Google data API server...
        my $entry = new WebService::GData::Error::Entry();
        $entry->code('too_long');
        $entry->domain('your_domain');
        $entry->location({type=>'header',content=>'Missing Version header'});
        print $entry->serialize()#return <error>...</error> entry

DESCRIPTION

inherits from WebService::GData;

This package can parse error response from Google APIs service. You can also create your own basic xml error.

All WebService::GData::* classes die a WebService::GData::Error object when something went wrong.

You should use an eval {}; block to catch the error.

Example:

        use WebService::GData::Error;

    #parse an error from a Google data API server...
        my $entry = new WebService::GData::Error::Entry($xmlerror);
        $entry->code;
        $entry->internalreason;
        $entry->domain;
        $entry->location->{type};#this is just a hash
        $entry->location->{content};#this is just a hash

    #create an error from a Google data API server...
        my $entry = new WebService::GData::Error::Entry();
        $entry->code('too_long');
        $entry->domain('your_domain');
        $entry->location({type=>'header',content=>'Missing Version header'});

METHODS

new (content:Scalar)

code

    Get/set an error code.

location

    Get/set the error location as an xpath.

    It requires an hash with type and content as keys.

domain

    Get/set the type of error. Google data API has validation,quota,authentication,service errors.

SEE ALSO

Format of the errors, kind of errors and details:

http://code.google.com/intl/en/apis/youtube/2.0/developers_guide_protocol_error_responses.html

CONFIGURATION AND ENVIRONMENT

none

DEPENDENCIES

JSON

LWP

INCOMPATIBILITIES

none

BUGS AND LIMITATIONS

If you do me the favor to _use_ this module and find a bug, please email me i will try to do my best to fix it (patches welcome)!

AUTHOR

shiriru <shiriru0111[arobas]hotmail.com>

LICENSE AND COPYRIGHT

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

4 POD Errors

The following errors were encountered while parsing the POD:

Around line 122:

You forgot a '=back' before '=head2'

Around line 128:

You forgot a '=back' before '=head2'

Around line 136:

You forgot a '=back' before '=head2'

Around line 142:

You forgot a '=back' before '=head1'