Skip to content

Commit 94634fe

Browse files
authored
[10.x] Avoid using rescue() in standalone illuminate/database component. (#49355)
fixes #49354 Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent 3e9301d commit 94634fe

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Illuminate/Database/Schema/SQLiteBuilder.php

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

33
namespace Illuminate\Database\Schema;
44

5+
use Illuminate\Database\QueryException;
56
use Illuminate\Support\Facades\File;
67

78
class SQLiteBuilder extends Builder
@@ -37,7 +38,13 @@ public function dropDatabaseIfExists($name)
3738
*/
3839
public function getTables()
3940
{
40-
$withSize = rescue(fn () => $this->connection->scalar($this->grammar->compileDbstatExists()), false, false);
41+
$withSize = false;
42+
43+
try {
44+
$withSize = $this->connection->scalar($this->grammar->compileDbstatExists());
45+
} catch (QueryException $e) {
46+
//
47+
}
4148

4249
return $this->connection->getPostProcessor()->processTables(
4350
$this->connection->selectFromWriteConnection($this->grammar->compileTables($withSize))

0 commit comments

Comments
 (0)