Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RufundUnitsHandler fails on PHP error somewhere in the process #208

Closed
Nek- opened this issue May 25, 2020 · 0 comments · Fixed by #209
Closed

RufundUnitsHandler fails on PHP error somewhere in the process #208

Nek- opened this issue May 25, 2020 · 0 comments · Fixed by #209

Comments

@Nek-
Copy link
Contributor

Nek- commented May 25, 2020

Those lines are a problem if at some point there's a PHP error:

$previousException = $exception->getPrevious();
$this->provideErrorMessage($previousException);

It will fail without rendering the actual error.

Suggestion:

-private function provideErrorMessage(\Exception $previousException): void
+private function provideErrorMessage(\Throwable $previousException): void
Nek- added a commit to Nek-/RefundPlugin that referenced this issue May 25, 2020
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 Sylius#208
GSadee pushed a commit to Nek-/RefundPlugin that referenced this issue Jan 7, 2021
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 Sylius#208
GSadee added a commit that referenced this issue Jan 7, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant