Catching Exceptions from the PHP Client Library

If you are using the PHP client library and see an error like "Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 400' in ..." What you should really do is surround your code in a try block and use a catch statement like this:
catch(Zend_Gdata_App_HttpException $exception) {
    echo "Error: " . $exception->getResponse()->getRawBody();
Usually this will print a more informative message describing the reason for failure.

1 comment:

Naviya Nair said...

I have read your blog its very attractive and impressive. I like it your blog.

PHP 7 Training in chennai | PHP 7 Training Course

PHP 7 Training in chennai | Online PHP 7 Course