Skip to content

Commit

Permalink
Fixed default behaviour (throwing) of exceptions that are caught in a…
Browse files Browse the repository at this point in the history
… transaction
  • Loading branch information
tg666 committed Apr 15, 2021
1 parent 3e2f156 commit 601eb2e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ public function run()
} catch (Throwable $e) {
$result = NULL;
$errorContext = $this->processError($e);

if (!$errorContext->isDefaultBehaviourPrevented()) {
throw $errorContext->getError();
}
} finally {
$this->processFinally($result, $errorContext ?? NULL);
}
Expand Down Expand Up @@ -243,10 +247,6 @@ private function processError(Throwable $e): ErrorContextInterface
$errorContext = new ErrorContext($e);
}

if (!$errorContext->isDefaultBehaviourPrevented()) {
throw $errorContext->getError();
}

return $errorContext;
}

Expand Down

0 comments on commit 601eb2e

Please sign in to comment.