Skip to content

Commit

Permalink
Merge pull request lorenzo#4 from risou/features/exception
Browse files Browse the repository at this point in the history
check Exception class in method _handleException
  • Loading branch information
lorenzo committed May 11, 2014
2 parents ba84f9a + 43c0c51 commit 9772d12
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Model/SimpleQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,16 @@ protected function _handleException(Exception $e) {
'AWS.SimpleQueueService.NonExistentQueue'
);

if (in_array($e->getExceptionCode(), $fatalErrors) || $this->_exceptionCount >= 25) {
if ($this->_exceptionCount >= 25) {
throw $e;
}

if ($e instanceof Aws\Common\Exception\ServiceResponseException) {
if (in_array($e->getExceptionCode(), $fatalErrors)) {
throw $e;
}
}

$this->_exceptionCount++;
CakeLog::error($e->getMessage(), 'sqs');
return false;
Expand Down

0 comments on commit 9772d12

Please sign in to comment.