From 4876ffa2fe68573ef1bfd78d6455811e787e5745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 22 Nov 2022 07:46:43 +0000 Subject: [PATCH 1/2] Improve exception message --- src/Pools/Pool.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pools/Pool.php b/src/Pools/Pool.php index 66e85c2..557a2f9 100644 --- a/src/Pools/Pool.php +++ b/src/Pools/Pool.php @@ -171,7 +171,7 @@ public function pop(): Connection if (is_null($connection)) { if ($attempts >= $this->getRetryAttempts()) { - throw new Exception('Pool is empty'); + throw new Exception('Pool "' . $this->name . '" is empty (size ' . $this->size . ')'); } sleep($this->getRetrySleep()); From 56e3fab15dd6a34f37c0145fb9b7d59f570c7b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 22 Nov 2022 07:54:18 +0000 Subject: [PATCH 2/2] PR review changes --- src/Pools/Pool.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pools/Pool.php b/src/Pools/Pool.php index 557a2f9..4d47106 100644 --- a/src/Pools/Pool.php +++ b/src/Pools/Pool.php @@ -171,7 +171,7 @@ public function pop(): Connection if (is_null($connection)) { if ($attempts >= $this->getRetryAttempts()) { - throw new Exception('Pool "' . $this->name . '" is empty (size ' . $this->size . ')'); + throw new Exception("Pool '{$this->name}' is empty (size {$this->size})"); } sleep($this->getRetrySleep());