Add support for throwables (>= PHP 7.0), not throwing UnexpectedValueException anymore#56
Add support for throwables (>= PHP 7.0), not throwing UnexpectedValueException anymore#56ivodvb wants to merge 1 commit intoclue:masterfrom
Conversation
|
@ivodvb Thanks for looking into this and filing this PR! It looks like a somewhat similar changeset has been proposed via #52. The changes look perfectly reasonable to me, but unfortunately this introduces a small BC break with regards to what types this project will throw. The original feature was introduced via #7/#27/#42. What do you think about this? |
|
Thanks for looking into the PR @clue. I definitely agree on the BC break. I think there are two options:
The first option is the most sane to me, I suggest to go with that one. |
|
@ivodvb I agree introducing a BC break is the way forward in the long run. I've discussed future options for this package with a number of people, so expect some major changes not too far in the future anyway 🤫 As an intermediary solution, I've just filed #57 which at least eases debugging by appending the original message for |
I'd like to propose the change to support Throwables next to Exceptions, so that they can be handled properly as well.
Throwables within PHP are supported since PHP 7.0. Currently only Exceptions are supported and Throwables will lead to an UnexpectedValueException. With this change Throwables are supported as well.
Given the direction reactphp/promise goes I think it would be good to make this change.