GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  WEBSERVICE::GDATA::ERROR::ENTRY (3)

.ds Aq ’

NAME

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

CONTENTS

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>



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.

XML error Example:



    <error>
         <domain>yt:validation</domain>
         <code>invalid_character</code>
         <location type=xpath>media:group/media:title/text()</location>
    </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});



    Constructor

new

Create a WebService::GData::Error::Entry instance. If the content is an xml following the Google data API format, it will get parse.

<B>ParametersB>
content:Scalar(optional)

<B>ReturnsB>
WebService::GData::Error::Entry

    GET/SET METHODS

These methods return their content if no parameters is passed or set their content if a parameter is set.

code

Get/set an error code.

<B>ParametersB>
none - Work as a getter
content:Scalar - Work as a setter

<B>ReturnsB>
content:Scalar (as a getter)

location

Get/set the error location as an xpath.It requires a ref hash with type and content as keys.

<B>ParametersB>
none - Work as a getter
content:HashRef - Work as a setter. the hash must be in contain the following : {type=>’...’,content=>’...’}.

<B>ReturnsB>
content:HashRef (as a getter)

Example:



    $error->location({type=>invalid_character,content=>The string contains an unsupported character.});



domain

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

<B>ParametersB>
none - Work as a getter
content:Scalar - Work as a setter.

<B>ReturnsB>
content:Scalar (as a getter)

serialize

Send back an xml representation of an error.

<B>ParametersB>
none

<B>ReturnsB>
content:Scalar - xml representation of the error.

    SEE ALSO

XML format overview and explanation of the different kind of errors you can encounter:

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

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 <shirirulestheworld[arobas]gmail.com>

LICENSE AND COPYRIGHT

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 WEBSERVICE::GDATA::ERROR::ENTRY (3) 2010-11-01

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.