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

Use stream_socket_client() exception for better message #183

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

rudiedirkx
Copy link
Contributor

stream_socket_client()'s $errorDescription misses a lot of error message. Most of the time (in my cases) it's just an empty string after a connection failure. But the exception is always a useful pretty error message. hostDoesNotExist, noCertificateInstalled and unknownError after that still work the same.

src/Downloader.php Show resolved Hide resolved
$streamContext
);
}
catch (\ErrorException $ex) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you import this, so we can lose the \. Also rename $ex to $exception.

@rudiedirkx
Copy link
Contributor Author

Crap. I missed this. I made the changes and forgot to push 🤦 Voila.

@rudiedirkx rudiedirkx requested a review from freekmurze October 13, 2023 01:20
@freekmurze freekmurze merged commit 3d6c876 into spatie:main Oct 17, 2023
4 checks passed
@freekmurze
Copy link
Member

Thanks!

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 this pull request may close these issues.

2 participants