1
0
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:
Mehrdad Esmaeilpour 2021-09-05 19:05:41 +04:30 committed by GitHub
parent 2d77dc5241
commit 9833955af5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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``.