Skip to content

Commit

Permalink
Fix exception handle. overtrue#90
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed May 3, 2018
1 parent e23f143 commit 20f0395
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Messenger.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Overtrue\EasySms;

use Overtrue\EasySms\Contracts\MessageInterface;
use Overtrue\EasySms\Exceptions\GatewayErrorException;
use Overtrue\EasySms\Exceptions\NoGatewayAvailableException;
use Overtrue\EasySms\Support\Config;

Expand Down Expand Up @@ -78,13 +77,16 @@ public function send($to, $message, array $gateways = [])
$isSuccessful = true;

break;
} catch (GatewayErrorException $e) {
} catch (\Throwable $e) {
$results[$gateway] = [
'status' => self::STATUS_FAILURE,
'exception' => $e,
];
} catch (\Exception $e) {
$results[$gateway] = [
'status' => self::STATUS_FAILURE,
'exception' => $e,
];

continue;
}
}

Expand Down

0 comments on commit 20f0395

Please sign in to comment.