From 06f945f27840b53e57795dadbc38e76f7e11ab1c Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 24 Feb 2014 16:42:14 +0100 Subject: init --- .../manual/core/en/zend.gdata.exception.html | 206 +++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 zend/documentation/manual/core/en/zend.gdata.exception.html (limited to 'zend/documentation/manual/core/en/zend.gdata.exception.html') diff --git a/zend/documentation/manual/core/en/zend.gdata.exception.html b/zend/documentation/manual/core/en/zend.gdata.exception.html new file mode 100644 index 0000000..7d5fdfd --- /dev/null +++ b/zend/documentation/manual/core/en/zend.gdata.exception.html @@ -0,0 +1,206 @@ + + + + + Catching Gdata Exceptions - Zend Framework Manual + + + + + + + + +
+ + + + + + + + +
+ Using the YouTube Data API + + + + +
+
+

Catching Gdata Exceptions

+ + +

+ The Zend_Gdata_App_Exception class is a base class + for exceptions thrown by Zend_Gdata. You can catch any exception + thrown by Zend_Gdata by catching + Zend_Gdata_App_Exception. +

+ +
  1. try {
  2. +
  3.     $client =
  4. +
  5.         Zend_Gdata_ClientLogin::getHttpClient($username, $password);
  6. +
  7. } catch(Zend_Gdata_App_Exception $ex) {
  8. +
  9.     // Report the exception to the user
  10. +
  11.     die($ex->getMessage());
  12. +
  13. }
+ + +

+ The following exception subclasses are used by Zend_Gdata: + +

    +
  • +

    + Zend_Gdata_App_AuthException + indicates that the user's account credentials were not valid. +

    +
  • + +
  • +

    + Zend_Gdata_App_BadMethodCallException + indicates that a method was called for a service + that does not support the method. For example, + the CodeSearch service does not support post(). +

    +
  • + +
  • +

    + Zend_Gdata_App_HttpException + indicates that an HTTP request was not successful. + Provides the ability to get the full Zend_Http_Response + object to determine the exact cause of the failure in + cases where $e->getMessage() does not provide + enough details. +

    +
  • + +
  • +

    + Zend_Gdata_App_InvalidArgumentException + is thrown when the application provides a value that + is not valid in a given context. For example, + specifying a Calendar visibility value of "banana", + or fetching a Blogger feed without specifying + any blog name. +

    +
  • + +
  • +

    + Zend_Gdata_App_CaptchaRequiredException + is thrown when a ClientLogin attempt receives a + CAPTCHA challenge from the + authentication service. This exception contains a token + ID and a URL to a CAPTCHA + challenge image. The image is a visual puzzle that + should be displayed to the user. After + collecting the user's response to the challenge + image, the response can be included with the next + ClientLogin attempt.The user can alternatively be + directed to this website: + https://www.google.com/accounts/DisplayUnlockCaptcha + Further information can be found in the + ClientLogin documentation. +

    +
  • +
+

+ +

+ You can use these exception subclasses to handle specific exceptions + differently. See the API documentation for information on which + exception subclasses are thrown by which methods in Zend_Gdata. +

+ +
  1. try {
  2. +
  3.     $client = Zend_Gdata_ClientLogin::getHttpClient($username,
  4. +
  5.                                                     $password,
  6. +
  7.                                                     $service);
  8. +
  9. } catch(Zend_Gdata_App_AuthException $authEx) {
  10. +
  11.     // The user's credentials were incorrect.
  12. +
  13.     // It would be appropriate to give the user a second try.
  14. +
  15.     ...
  16. +
  17. } catch(Zend_Gdata_App_HttpException $httpEx) {
  18. +
  19.     // Google Data servers cannot be contacted.
  20. +
  21.     die($httpEx->getMessage);}
+ +
+
+ + + + + + + + + +
+ Using the YouTube Data API + + + + +
+
+ +
+ + \ No newline at end of file -- cgit v1.2.3