PDOException 클래스

(PHP 5 >= 5.1.0, PHP 7, PHP 8)


소개

PDO에서 발생한 오류를 나타냅니다. 자신의 코드에서 PDOException을 throw해서는 안 됩니다. PHP의 예외에 대한 자세한 내용은 예외를 참조하십시오.


클래스 개요

class PDOException extends RuntimeException {
  /* Properties */
  protected int|string $code;
  public ?array $errorInfo = null;
  /* Inherited properties */
  protected string $message = "";
  private string $string = "";
  protected int $code;
  protected string $file = "";
  protected int $line;
  private array $trace = [];
  private ?Throwable $previous = null;
  /* Inherited methods */
  final public Exception::getMessage(): string
  final public Exception::getPrevious(): ?Throwable
  final public Exception::getCode(): int
  final public Exception::getFile(): string
  final public Exception::getLine(): int
  final public Exception::getTrace(): array
  final public Exception::getTraceAsString(): string
  public Exception::__toString(): string
  private Exception::__clone(): void
}
                

속성

errorInfo
PDO::errorInfo() 또는 PDOStatement::errorInfo()에 해당합니다.
code
SQLSTATE 오류 코드. Exception::getCode()를 사용하여 액세스합니다.