OCI8Exception.php 597 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Doctrine\DBAL\Driver\OCI8;
  3. use Doctrine\DBAL\Driver\AbstractDriverException;
  4. /**
  5. * @deprecated Use {@link Exception} instead
  6. *
  7. * @psalm-immutable
  8. */
  9. class OCI8Exception extends AbstractDriverException
  10. {
  11. /**
  12. * @param mixed[]|false $error
  13. *
  14. * @return OCI8Exception
  15. */
  16. public static function fromErrorInfo($error)
  17. {
  18. if ($error === false) {
  19. return new self('Database error occurred but no error information was retrieved from the driver.');
  20. }
  21. return new self($error['message'], null, $error['code']);
  22. }
  23. }