We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent add453f commit 53e935bCopy full SHA for 53e935b
1 file changed
system/Database/SQLite3/Connection.php
@@ -171,9 +171,10 @@ protected function execute(string $sql)
171
'trace' => render_backtrace($e->getTrace()),
172
]);
173
174
+ $error = $this->error();
175
$exception = $this->isUniqueConstraintViolation($e->getMessage())
- ? new UniqueConstraintViolationException($e->getMessage(), $e->getCode(), $e)
176
- : new DatabaseException($e->getMessage(), $e->getCode(), $e);
+ ? new UniqueConstraintViolationException($e->getMessage(), $error['code'], $e)
177
+ : new DatabaseException($e->getMessage(), $error['code'], $e);
178
179
if ($this->DBDebug) {
180
throw $exception;
0 commit comments