IncompleteDsnException.php 841 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Notifier\Exception;
  11. /**
  12. * @author Fabien Potencier <fabien@symfony.com>
  13. *
  14. * @experimental in 5.1
  15. */
  16. class IncompleteDsnException extends InvalidArgumentException
  17. {
  18. private $dsn;
  19. public function __construct(string $message, string $dsn = null, ?\Throwable $previous = null)
  20. {
  21. $this->dsn = $dsn;
  22. if ($dsn) {
  23. $message = sprintf('Invalid "%s" notifier DSN: ', $dsn).$message;
  24. }
  25. parent::__construct($message, 0, $previous);
  26. }
  27. public function getOriginalDsn(): string
  28. {
  29. return $this->dsn;
  30. }
  31. }