Skip to content

Commit 53e935b

Browse files
committed
fix sqlite3
1 parent add453f commit 53e935b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

system/Database/SQLite3/Connection.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ protected function execute(string $sql)
171171
'trace' => render_backtrace($e->getTrace()),
172172
]);
173173

174+
$error = $this->error();
174175
$exception = $this->isUniqueConstraintViolation($e->getMessage())
175-
? new UniqueConstraintViolationException($e->getMessage(), $e->getCode(), $e)
176-
: new DatabaseException($e->getMessage(), $e->getCode(), $e);
176+
? new UniqueConstraintViolationException($e->getMessage(), $error['code'], $e)
177+
: new DatabaseException($e->getMessage(), $error['code'], $e);
177178

178179
if ($this->DBDebug) {
179180
throw $exception;

0 commit comments

Comments
 (0)