Skip to content

Commit

Permalink
Fix wrong type error if the error in some cases
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Nek- authored and GSadee committed Jan 7, 2021
1 parent 33cdd26 commit f998e0e
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 f998e0e

Please sign in to comment.