title: Catching an error with put object and s3
body: <p>I'm using S3 php sdk and the larval implementation of this to put an object on to S3.</p>
  
  <pre><code>try {
      $s3-&gt;putObject(array(
      'Bucket' =&gt; 'mybucket', 
      'Key' =&gt;  'abc',
      'Body' =&gt; $img-&gt;encode(null, 90),
      'ACL' =&gt; 'public-read',
      'ContentType' =&gt; $img-&gt;mime()
  ));
  
  }
  catch (S3Exception $e) {
  
      var_dump('error');
      die();
  }
  </code></pre>
  
  <p>But the above code does not seem to catch errors. I set an incorrect bucket and I still get the error:</p>
  
  <pre><code>type:Aws\S3\Exception\NoSuchBucketException, message:The specified bucket does not exist,…
  </code></pre>
  
  <p>How can I catch this error and act on it accordingly.</p>