1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-05-06 18:04:03 +00:00

Catch broader range of exceptions (harden() in DB bootstrapper)

This commit is contained in:
lukinovec 2026-05-04 12:14:39 +02:00
parent 98a808bb98
commit 6ed9975e85

View file

@ -13,6 +13,7 @@ use Stancl\Tenancy\Contracts\Tenant;
use Stancl\Tenancy\Database\Contracts\TenantWithDatabase; use Stancl\Tenancy\Database\Contracts\TenantWithDatabase;
use Stancl\Tenancy\Database\DatabaseManager; use Stancl\Tenancy\Database\DatabaseManager;
use Stancl\Tenancy\Database\Exceptions\TenantDatabaseDoesNotExistException; use Stancl\Tenancy\Database\Exceptions\TenantDatabaseDoesNotExistException;
use Throwable;
class DatabaseTenancyBootstrapper implements TenancyBootstrapper class DatabaseTenancyBootstrapper implements TenancyBootstrapper
{ {
@ -54,7 +55,7 @@ class DatabaseTenancyBootstrapper implements TenancyBootstrapper
if (static::$harden) { if (static::$harden) {
try { try {
$this->harden($tenant); $this->harden($tenant);
} catch (RuntimeException $e) { } catch (Throwable $e) {
// Revert connection back to central // Revert connection back to central
$this->revert(); $this->revert();