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

Improve error reporting by appending previous message for Throwables #57

Merged
merged 1 commit into from
Oct 17, 2021

Conversation

clue
Copy link
Owner

@clue clue commented Oct 17, 2021

This changeset improves error reporting by appending previous exception messages for Throwables (PHP 7+). This improves DX by making it easier to see the underlying error causes without having to check the previous exception via $e->getPrevious().

Ideally, this would just throw the Throwable without wrapping this in an UnexpectedValueException, but this would constitute a BC break. Appending the original type and message to the UnexpectedValueException at least makes it more obvious to see the underlying error condition without introducing a BC break.

Supersedes / closes #52
Supersedes / closes #56
Builds on top of #7/#27/#42
Refs reactphp/promise-stream#26, friends-of-reactphp/mysql#141 and others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants