Feat: Exception handling
This PR adds exception handling to the downloader and allows middleware to act upon caught exceptions.
Personally, I need this for handling Javascript (Browsershot) exceptions, so I can retry them. In order to act upon thrown exceptions during the request being sent, exception handling is needed at the downloader level.
There is one problem I'm still solving: throwing the exception when it hasn't been handled.
@ksassnowski I implemented a feature that throws exceptions when they are not handled by any middleware.
To achieve this, we need to track whether an exception has been handled, so I decided to wrap exceptions with a RequestException and maintain the handled state within that class.
I would appreciate it if you could review this and share your feedback!