Server IP : 23.254.227.96 / Your IP : 216.73.216.7 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/viralblo/instantblog/vendor/laravel/framework/src/Illuminate/Database/ |
Upload File : |
<?php namespace Illuminate\Database; use Illuminate\Support\Str; use PDOException; use Throwable; class QueryException extends PDOException { /** * The SQL for the query. * * @var string */ protected $sql; /** * The bindings for the query. * * @var array */ protected $bindings; /** * Create a new query exception instance. * * @param string $sql * @param array $bindings * @param \Throwable $previous * @return void */ public function __construct($sql, array $bindings, Throwable $previous) { parent::__construct('', 0, $previous); $this->sql = $sql; $this->bindings = $bindings; $this->code = $previous->getCode(); $this->message = $this->formatMessage($sql, $bindings, $previous); if ($previous instanceof PDOException) { $this->errorInfo = $previous->errorInfo; } } /** * Format the SQL error message. * * @param string $sql * @param array $bindings * @param \Throwable $previous * @return string */ protected function formatMessage($sql, $bindings, Throwable $previous) { return $previous->getMessage().' (SQL: '.Str::replaceArray('?', $bindings, $sql).')'; } /** * Get the SQL for the query. * * @return string */ public function getSql() { return $this->sql; } /** * Get the bindings for the query. * * @return array */ public function getBindings() { return $this->bindings; } }