ExceptionConverterDriver.php 836 B

12345678910111213141516171819202122
  1. <?php
  2. namespace Doctrine\DBAL\Driver;
  3. /**
  4. * Contract for a driver that is capable of converting DBAL driver exceptions into standardized DBAL driver exceptions.
  5. */
  6. interface ExceptionConverterDriver
  7. {
  8. /**
  9. * Converts a given DBAL driver exception into a standardized DBAL driver exception.
  10. *
  11. * It evaluates the vendor specific error code and SQLSTATE and transforms
  12. * it into a unified {@link Doctrine\DBAL\Exception\DriverException} subclass.
  13. *
  14. * @param string $message The DBAL exception message to use.
  15. * @param DriverException $exception The DBAL driver exception to convert.
  16. *
  17. * @return \Doctrine\DBAL\Exception\DriverException An instance of one of the DriverException subclasses.
  18. */
  19. public function convertException($message, DriverException $exception);
  20. }