Skip to content
Snippets Groups Projects

Resolve #3346676 "Dont requeue test mails"

6 files
+ 102
14
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 32
0
<?php
declare(strict_types=1);
namespace Drupal\mailgun\Exception;
/**
* Exception thrown when the Mailgun client encounters an error.
*/
class MailgunClientException extends \RuntimeException {
/**
* Create a new MailgunClientException from an exception.
*
* @param \Exception $e
* The exception to create the MailgunClientException from.
* @param ?string $message
* Optional message to use for the exception.
* @param ?int $code
* Optional code to use for the exception.
*
* @return \Drupal\mailgun\Exception\MailgunClientException
* The new MailgunClientException.
*/
public static function fromException(\Exception $e, ?string $message = NULL, ?int $code = NULL): MailgunClientException {
$message = $message ?? $e->getMessage();
$code = $code ?? $e->getCode();
return new static($message, $code, $e);
}
}
Loading