File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1312,6 +1312,16 @@ protected function processException(PDOException $e): \Exception
13121312 return new TimeoutException ('Query timed out ' , $ e ->getCode (), $ e );
13131313 }
13141314
1315+ // Table/index already exists (SQLITE_ERROR with "already exists" message)
1316+ if ($ e ->getCode () === 'HY000 ' && isset ($ e ->errorInfo [1 ]) && $ e ->errorInfo [1 ] === 1 && stripos ($ e ->getMessage (), 'already exists ' ) !== false ) {
1317+ return new DuplicateException ('Collection already exists ' , $ e ->getCode (), $ e );
1318+ }
1319+
1320+ // Table not found (SQLITE_ERROR with "no such table" message)
1321+ if ($ e ->getCode () === 'HY000 ' && isset ($ e ->errorInfo [1 ]) && $ e ->errorInfo [1 ] === 1 && stripos ($ e ->getMessage (), 'no such table ' ) !== false ) {
1322+ return new NotFoundException ('Collection not found ' , $ e ->getCode (), $ e );
1323+ }
1324+
13151325 // Duplicate - SQLite uses various error codes for constraint violations:
13161326 // - Error code 19 is SQLITE_CONSTRAINT (includes UNIQUE violations)
13171327 // - Error code 1 is also used for some duplicate cases
@@ -1320,7 +1330,6 @@ protected function processException(PDOException $e): \Exception
13201330 ($ e ->getCode () === 'HY000 ' && isset ($ e ->errorInfo [1 ]) && ($ e ->errorInfo [1 ] === 1 || $ e ->errorInfo [1 ] === 19 )) ||
13211331 $ e ->getCode () === '23000 '
13221332 ) {
1323- // Check if it's actually a duplicate/unique constraint violation
13241333 $ message = $ e ->getMessage ();
13251334 if (
13261335 (isset ($ e ->errorInfo [1 ]) && $ e ->errorInfo [1 ] === 19 ) ||
You can’t perform that action at this time.
0 commit comments