mirror of
https://github.com/guzzle/guzzle.git
synced 2025-01-16 21:08:13 +01:00
Update quick start docs (#2921)
This commit is contained in:
parent
2d77dc5241
commit
9833955af5
@ -547,26 +547,6 @@ on each other.
|
||||
|
||||
Guzzle throws exceptions for errors that occur during a transfer.
|
||||
|
||||
- In the event of a networking error (connection timeout, DNS errors, etc.),
|
||||
a ``GuzzleHttp\Exception\RequestException`` is thrown. This exception
|
||||
extends from ``GuzzleHttp\Exception\TransferException``. Catching this
|
||||
exception will catch any exception that can be thrown while transferring
|
||||
requests.
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use GuzzleHttp\Psr7;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
|
||||
try {
|
||||
$client->request('GET', 'https://github.com/_abc_123_404');
|
||||
} catch (RequestException $e) {
|
||||
echo Psr7\Message::toString($e->getRequest());
|
||||
if ($e->hasResponse()) {
|
||||
echo Psr7\Message::toString($e->getResponse());
|
||||
}
|
||||
}
|
||||
|
||||
- A ``GuzzleHttp\Exception\ConnectException`` exception is thrown in the
|
||||
event of a networking error. This exception extends from
|
||||
``GuzzleHttp\Exception\TransferException``.
|
||||
|
Loading…
x
Reference in New Issue
Block a user