From d137293aa55e427bfe667c7874c457b048130f58 Mon Sep 17 00:00:00 2001 From: antonkomarev Date: Thu, 26 Sep 2019 07:43:12 +0300 Subject: [PATCH] Specify exact exception type --- src/Middleware/InitializeTenancy.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Middleware/InitializeTenancy.php b/src/Middleware/InitializeTenancy.php index 00929c4a..87636da3 100644 --- a/src/Middleware/InitializeTenancy.php +++ b/src/Middleware/InitializeTenancy.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Stancl\Tenancy\Middleware; use Closure; +use Stancl\Tenancy\Exceptions\TenantCouldNotBeIdentifiedException; class InitializeTenancy { @@ -31,7 +32,7 @@ class InitializeTenancy { try { tenancy()->init(); - } catch (\Exception $e) { + } catch (TenantCouldNotBeIdentifiedException $e) { ($this->onFail)($e); }