Skip to content

Commit a12b8e7

Browse files
committed
Change Exception Type
1 parent 88f7f52 commit a12b8e7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

system/Database/Postgre/Builder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use CodeIgniter\Database\BaseBuilder;
1515
use CodeIgniter\Database\Exceptions\DatabaseException;
16+
use CodeIgniter\Database\InvalidArgumentException;
1617
use CodeIgniter\Database\RawSql;
1718

1819
/**
@@ -367,7 +368,7 @@ protected function _upsertBatch(string $table, array $keys, array $values): stri
367368
$alias = $this->QBOptions['alias'] ?? '"excluded"';
368369

369370
if (strtolower($alias) !== '"excluded"') {
370-
throw new DatabaseException('Postgres alias is always named "excluded". A custom alias cannot be used.');
371+
throw new InvalidArgumentException('Postgres alias is always named "excluded". A custom alias cannot be used.');
371372
}
372373

373374
$updateFields = $this->QBOptions['updateFields'] ?? $this->updateFields($keys, false, $constraints)->QBOptions['updateFields'] ?? [];

system/Database/SQLite3/Builder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use CodeIgniter\Database\BaseBuilder;
1515
use CodeIgniter\Database\Exceptions\DatabaseException;
16+
use CodeIgniter\Database\InvalidArgumentException;
1617
use CodeIgniter\Database\RawSql;
1718

1819
/**
@@ -167,7 +168,7 @@ protected function _upsertBatch(string $table, array $keys, array $values): stri
167168
$alias = $this->QBOptions['alias'] ?? '`excluded`';
168169

169170
if (strtolower($alias) !== '`excluded`') {
170-
throw new DatabaseException('SQLite alias is always named "excluded". A custom alias cannot be used.');
171+
throw new InvalidArgumentException('SQLite alias is always named "excluded". A custom alias cannot be used.');
171172
}
172173

173174
$updateFields = $this->QBOptions['updateFields'] ??

0 commit comments

Comments
 (0)