Skip to content

Commit

Permalink
refactor #209 Fix wrong type error if the error in some cases (Nek-)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.0-dev branch.

Discussion
----------

Problem
-------

The raised error may be a throwable since the user is supposed to add its custom code with handlers. But since this is type hinted Exception, the real failure will be hidden by this new TypeError.

Solution
--------

Accept Throwable instead.

Fixes #208

Commits
-------

f998e0e Fix wrong type error if the error in some cases
  • Loading branch information
GSadee authored Jan 7, 2021
2 parents 860b970 + f998e0e commit 4d79cbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Action/Admin/RefundUnitsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __invoke(Request $request): Response
));
}

private function provideErrorMessage(\Exception $previousException): void
private function provideErrorMessage(\Throwable $previousException): void
{
if ($previousException instanceof InvalidRefundAmountException) {
$this->session->getFlashBag()->add('error', $previousException->getMessage());
Expand Down

0 comments on commit 4d79cbd

Please sign in to comment.