Skip to content

Commit

Permalink
update exception messaging and pass in previous exception (#1204)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwsupplee authored Aug 2, 2018
1 parent 89506e2 commit 791e005
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Core/src/Lock/SymfonyLockAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}

Expand All @@ -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
);
}
}
}

0 comments on commit 791e005

Please sign in to comment.