feat(mail) : MailProviderInterface + MailProviderException
This commit is contained in:
20
src/Mail/Exception/MailProviderException.php
Normal file
20
src/Mail/Exception/MailProviderException.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Mail\Exception;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
final class MailProviderException extends RuntimeException
|
||||
{
|
||||
public static function connectionFailed(string $reason): self
|
||||
{
|
||||
return new self(sprintf('Mail provider connection failed: %s', $reason));
|
||||
}
|
||||
|
||||
public static function operationFailed(string $operation, string $reason): self
|
||||
{
|
||||
return new self(sprintf('Mail provider operation "%s" failed: %s', $operation, $reason));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user