getMessage() . "\nQuery: " . $this->getQueryString(); parent::__construct($message, (int)$previous->getCode(), $previous); } /** * Get the query string that caused this exception. * * @return string */ public function getQueryString(): string { if ($this->query instanceof LoggedQuery) { return (string)$this->query; } return $this->query; } }