1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-05-07 02:24: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\DatabaseManager;
use Stancl\Tenancy\Database\Exceptions\TenantDatabaseDoesNotExistException;
use Throwable;
class DatabaseTenancyBootstrapper implements TenancyBootstrapper
{
@ -54,7 +55,7 @@ class DatabaseTenancyBootstrapper implements TenancyBootstrapper
if (static::$harden) {
try {
$this->harden($tenant);
} catch (RuntimeException $e) {
} catch (Throwable $e) {
// Revert connection back to central
$this->revert();