andreshg112/hablame-sms

View on GitHub
src/Exceptions/CouldNotSendNotification.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Andreshg112\HablameSms\Exceptions;

use function GuzzleHttp\json_encode;

class CouldNotSendNotification extends \Exception
{
    public static function serviceRespondedWithAnError(array $response): self
    {
        $encodedResponse = json_encode($response);

        return new static("Message could not be sent: {$encodedResponse}");
    }
}