From 37cc487527a7f571d42f56a6fcc9041de79fb065 Mon Sep 17 00:00:00 2001 From: Dave Supplee Date: Thu, 2 Aug 2018 14:44:37 -0400 Subject: [PATCH] update exception messaging and pass in previous exception --- 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 + ); } } }