diff --git a/src/Exception/ChargeStealingException.php b/src/Exception/ChargeStealingException.php deleted file mode 100644 index 81ea286d..00000000 --- a/src/Exception/ChargeStealingException.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -final class ChargeStealingException extends Exception implements ExceptionInterface, HasContextInterface -{ - use HasContext; - - public static function fromPdoException(ChargeInterface $charge, Exception $exception): self - { - $self = new self(sprintf( - 'Charge being saved tries to steal an existing charge from another bill: %s', - self::trimExceptionMessage($exception->getMessage()) - )); - $self->addContext(['charge' => $charge]); - - return $self; - } - - private static function trimExceptionMessage(string $message): string - { - return preg_replace('/^.+ERROR:\s+([^\n]+).+$/s', '$1', $message); - } -}