HTTPlug defines a common interface for all exceptions thrown by HTTPlug implementations.
Every exception thrown by a HTTP client must implement
HttpClient::sendRequest() can throw one of the following exceptions.
|Exception||Thrown when||Methods available|
|TransferException||something unexpected happened||-|
|└ RequestException||the request is invalid||
|└ NetworkException||no response received due to network issues||
|└ HttpException||error response||
By default clients will always return a PSR-7 response instead of throwing a
HttpException. Write your
application to check the response status or use the :doc:`/plugins/error` to make sure
HttpException is thrown.
sendAsyncRequest should never throw an exception but always return a
:doc:`../components/promise`. The exception classes used in
Promise::wait and the
callback are however the same as explained here.