ash-jc-allen / favicon-fetcher

A Laravel package for fetching favicons from websites.
MIT License
173 stars 13 forks source link

Add `timeout` and `connect_timeout` config #67

Closed ash-jc-allen closed 1 year ago

ash-jc-allen commented 1 year ago

This PR adds two new config fields: timeout and connect_timeout. Both of these config fields will be passed to the Http facade when attempting to make any HTTP requests.

To reduce duplication, I've moved the Http client instantiation to a new httpClient method inside a trait.

I've also added a new withRequestExceptionHandling method that can be used to catch any vendor request exceptions and rethrow them as package-specific exceptions. This is a breaking change because if anyone was trying to catch the old exceptions, their code would no longer work.