ZF-9436: Allow error handling for users of Zend_Service_Amazon_S3

Issue Type: Improvement Created: 2010-03-16T11:33:38.000+0000 Last Updated: 2012-11-20T21:37:43.000+0000 Status: Open Fix version(s): Reporter: David Bernal (davidbernal) Assignee: None Tags: - Zend_Service_Amazon

Related issues: Attachments:


I've used Zend's S3 class quite a bit, and have always been annoyed that when its not working, it's difficult to figure out what went wrong. There might be a way to do it, but if there is, it's poorly documented.

For example, I recently had a case where a getObject call was returning false on one of my servers, while the code worked just fine on others. This was very confusing to me, which was compounded by the fact that there's no way to get the error, or even the response object (again, that I know of). What I ended up doing was going into the getObject method and var_dump ing the response object. This worked, and helped me find my error, but in a production system is obviously not a viable way of handling errors. Imagine if this had happened on a deployed site, there would be no way for me to log what went wrong without hacking at the class itself.

What I would ideally like to see would be, anytime there's a response code other than 200 (in my case, it was a 403, and the issue ended up being that the server time was way off), an exception should be thrown with the content of the element. Here was my element:

RequestTimeTooSkewed The difference between the request time and the current time is too large.900000 ..snip.. Wed, 17 Mar 2010 01:05:11 +00002010-03-16T18:05:27Z

Even if throwing exceptions isn't a viable solution (I realize it could be a pretty major change for your users), maybe a getLastError method could be added, or even just a way of obtaining the response object.


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2021 by Zend by Perforce. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.