dbError = $dbError; $this->sql = $sql; parent::__construct($message); } final public function getSql() { return $this->sql; } final public function getDbError() { return $this->dbError; } public function __toString() { $s = parent::__toString(); if ($this->dbError) { $s .= "\n\nDatabase error: "; if (isset($this->dbError['code'])) $s .= "[" . $this->dbError['code'] . "] "; $s .= $this->dbError['message']; } if ($this->sql) $s .= "\nSQL: " . $this->sql; return $s; } } // class DibiException