Skip to content

Commit

Permalink
[10.x] Avoid using rescue() in standalone illuminate/database com…
Browse files Browse the repository at this point in the history
…ponent.

fixes #49354

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Dec 13, 2023
1 parent 9fe14c8 commit a85815d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Illuminate/Database/Schema/SQLiteBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Database\Schema;

use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\File;

class SQLiteBuilder extends Builder
Expand Down Expand Up @@ -37,7 +38,13 @@ public function dropDatabaseIfExists($name)
*/
public function getTables()
{
$withSize = rescue(fn () => $this->connection->scalar($this->grammar->compileDbstatExists()), false, false);
$withSize = false;

try {
$withSize = $this->connection->scalar($this->grammar->compileDbstatExists());
} catch (QueryException $e) {
//
}

return $this->connection->getPostProcessor()->processTables(
$this->connection->selectFromWriteConnection($this->grammar->compileTables($withSize))
Expand Down

0 comments on commit a85815d

Please sign in to comment.