src/Exceptions/CouldNotSendNotification.php
<?php
declare(strict_types=1);
namespace Zing\LaravelSms\Exceptions;
use Throwable;
class CouldNotSendNotification extends Exception
{
/**
* @var mixed[]
*/
public $raw = [];
/**
* @param mixed[] $raw
*/
public function __construct(string $message = '', int $code = 0, array $raw = [])
{
parent::__construct($message, $code);
$this->raw = $raw;
}
public static function captureExceptionInDriver(Throwable $exception): self
{
if ($exception instanceof self) {
return $exception;
}
return new self($exception->getMessage(), $exception->getCode());
}
}