<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -298,9 +298,13 @@ class Lux_Service_Amazon_S3 extends Solar_Base
         $content = $response-&gt;getContent();
         
         // default error code
-        $code = 'ERR_RESPONSE';
+        $code = 'ERR_UNEXPECTED_STATUS';
         
-        if (! empty($content)) {
+        $status_code = $response-&gt;getStatusCode();
+        
+        // if this was an actual error with error content
+        // we'll parse the content
+        if ($status_code &gt;= 400 &amp;&amp; ! empty($content)) {
             // parse error message
             $xml = new SimpleXMLElement($content);
             </diff>
      <filename>Lux/Service/Amazon/S3.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e27a16ca1e8039b4c583b87d183817af53a7fc13</id>
    </parent>
  </parents>
  <author>
    <name>Antti Holvikari</name>
    <email>anttih@gmail.com</email>
  </author>
  <url>http://github.com/anttih/lux/commit/a310ee3b8a28478bf7e24b06eb20fd756e196a4a</url>
  <id>a310ee3b8a28478bf7e24b06eb20fd756e196a4a</id>
  <committed-date>2008-06-29T09:50:39-07:00</committed-date>
  <authored-date>2008-06-29T09:50:39-07:00</authored-date>
  <message>s3: error handling

* [CHG] Changed default status code to ERR_UNEXPECTED_STATUS

* [CHG] Only parse response content if an actual error was returned from Amazon (it might not be an actual error if we were expecting an error and did not get it)</message>
  <tree>334949b2c00759e87774ee4adfb21a4d9fac94de</tree>
  <committer>
    <name>Antti Holvikari</name>
    <email>anttih@gmail.com</email>
  </committer>
</commit>
