mirror of
https://github.com/danog/postgres.git
synced 2024-12-02 09:27:54 +01:00
Move sql argument
This commit is contained in:
parent
1e0355cf4c
commit
43c8dab5c2
@ -268,7 +268,7 @@ final class PgSqlHandle implements Handle
|
|||||||
foreach (self::DIAGNOSTIC_CODES as $fieldCode => $description) {
|
foreach (self::DIAGNOSTIC_CODES as $fieldCode => $description) {
|
||||||
$diagnostics[$description] = \pg_result_error_field($result, $fieldCode);
|
$diagnostics[$description] = \pg_result_error_field($result, $fieldCode);
|
||||||
}
|
}
|
||||||
throw new QueryExecutionError(\pg_result_error($result), $diagnostics, null, $sql);
|
throw new QueryExecutionError(\pg_result_error($result), $diagnostics, $sql);
|
||||||
|
|
||||||
case \PGSQL_BAD_RESPONSE:
|
case \PGSQL_BAD_RESPONSE:
|
||||||
throw new FailureException(\pg_result_error($result));
|
throw new FailureException(\pg_result_error($result));
|
||||||
@ -419,7 +419,7 @@ final class PgSqlHandle implements Handle
|
|||||||
foreach (self::DIAGNOSTIC_CODES as $fieldCode => $description) {
|
foreach (self::DIAGNOSTIC_CODES as $fieldCode => $description) {
|
||||||
$diagnostics[$description] = \pg_result_error_field($result, $fieldCode);
|
$diagnostics[$description] = \pg_result_error_field($result, $fieldCode);
|
||||||
}
|
}
|
||||||
throw new QueryExecutionError(\pg_result_error($result), $diagnostics, null, $sql);
|
throw new QueryExecutionError(\pg_result_error($result), $diagnostics, $sql);
|
||||||
|
|
||||||
case \PGSQL_BAD_RESPONSE:
|
case \PGSQL_BAD_RESPONSE:
|
||||||
throw new FailureException(\pg_result_error($result));
|
throw new FailureException(\pg_result_error($result));
|
||||||
|
@ -240,7 +240,7 @@ final class PqHandle implements Handle
|
|||||||
|
|
||||||
case pq\Result::NONFATAL_ERROR:
|
case pq\Result::NONFATAL_ERROR:
|
||||||
case pq\Result::FATAL_ERROR:
|
case pq\Result::FATAL_ERROR:
|
||||||
throw new QueryExecutionError($result->errorMessage, $result->diag, null, $sql ?? '');
|
throw new QueryExecutionError($result->errorMessage, $result->diag, $sql ?? '');
|
||||||
|
|
||||||
case pq\Result::BAD_RESPONSE:
|
case pq\Result::BAD_RESPONSE:
|
||||||
throw new FailureException($result->errorMessage);
|
throw new FailureException($result->errorMessage);
|
||||||
|
@ -9,7 +9,7 @@ class QueryExecutionError extends QueryError
|
|||||||
/** @var mixed[] */
|
/** @var mixed[] */
|
||||||
private $diagnostics;
|
private $diagnostics;
|
||||||
|
|
||||||
public function __construct(string $message, array $diagnostics, \Throwable $previous = null, string $query = '')
|
public function __construct(string $message, array $diagnostics, string $query = '', \Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, $query, $previous);
|
parent::__construct($message, $query, $previous);
|
||||||
$this->diagnostics = $diagnostics;
|
$this->diagnostics = $diagnostics;
|
||||||
|
Loading…
Reference in New Issue
Block a user