amazon-s3-php-class icon indicating copy to clipboard operation
amazon-s3-php-class copied to clipboard

Fixed non-existent property "code" in response object (on failure) ..

Open adambisek opened this issue 12 years ago • 2 comments

When I used invalidateDistribution(), calling this method caused Notice. Reason is, StdClass with response does not contains property code (at least on request failure)..

adambisek avatar Sep 20 '13 10:09 adambisek

Your commit changes getBucket(), not invalidateDistribution(). Have you applied the correct changes?

Note that $response->code is used for HTTP status, $response->error->code is used for other error types - CURL, AWS, etc.

tpyo avatar Sep 20 '13 11:09 tpyo

Yes it is correct changes. I dont know detailly this library, but this fix helps me, to avoid notice (or Warning, I dont rememeber), when I call invalidateDistribution(). Try call this method, when you get failure. For example: call it with path without slash on the beginning of filenames to invalidate -> invalidateDistribution("distribtuinId", array("filename-without-slash.png"))

adambisek avatar Sep 20 '13 11:09 adambisek