Skip to content

Commit ea4cf7f

Browse files
committed
TASK: Use finally to save unnecessary code lines
1 parent a55c094 commit ea4cf7f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Classes/ElasticSearchClient.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,8 @@ public function withDimensions(\Closure $closure, array $dimensionValues = []):
9898
try {
9999
$this->setDimensions($dimensionValues);
100100
$closure();
101+
} finally {
101102
$this->dimensionsHash = $previousDimensionHash;
102-
} catch (\Exception $exception) {
103-
$this->dimensionsHash = $previousDimensionHash;
104-
throw $exception;
105103
}
106104
}
107105

0 commit comments

Comments
 (0)