From 791e005480b5141ba1d2b22b9e769b6bf38d10df Mon Sep 17 00:00:00 2001 From: David Supplee Date: Thu, 2 Aug 2018 16:30:38 -0400 Subject: [PATCH] update exception messaging and pass in previous exception (#1204) --- Core/src/Lock/SymfonyLockAdapter.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Core/src/Lock/SymfonyLockAdapter.php b/Core/src/Lock/SymfonyLockAdapter.php index 7736b8bb9a2d..84972ee1b1b5 100644 --- a/Core/src/Lock/SymfonyLockAdapter.php +++ b/Core/src/Lock/SymfonyLockAdapter.php @@ -60,7 +60,14 @@ public function acquire(array $options = []) try { return $this->lock->acquire($options['blocking']); } catch (\Exception $ex) { - throw new \RuntimeException($ex->getMessage()); + throw new \RuntimeException( + sprintf( + 'Acquiring the lock failed with the following message: %s', + $ex->getMessage() + ), + 0, + $ex + ); } } @@ -74,7 +81,14 @@ public function release() try { $this->lock->release(); } catch (\Exception $ex) { - throw new \RuntimeException($ex->getMessage()); + throw new \RuntimeException( + sprintf( + 'Releasing the lock failed with the following message: %s', + $ex->getMessage() + ), + 0, + $ex + ); } } }