Skip to content

Commit

Permalink
Add docs logo
Browse files Browse the repository at this point in the history
  • Loading branch information
firstred committed Apr 2, 2021
1 parent 7fd2915 commit 97f2792
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_logo = 'img/postnlphp.png'
html_theme_options = {
'logo_only': True,
'display_version': True,
}
#html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
Expand All @@ -139,7 +144,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
51 changes: 51 additions & 0 deletions docs/exceptionhandling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,54 @@
==================
Exception handling
==================

**Tree View**

The following tree view describes how the exceptions used in this library depend
on each other.

.. code-block:: none
. \Exception
├── Firstred\PostNL\Exception\PostNLException
│ ├── Firstred\PostNL\Exception\ApiException
│ │ ├── Firstred\PostNL\Exception\ApiConnectionException
│ │ ├── Firstred\PostNL\Exception\CifDownException
│ │ ├── Firstred\PostNL\Exception\CifException
│ │ ├── Firstred\PostNL\Exception\NotFoundException
│ │ ├── Firstred\PostNL\Exception\ResponseException
│ │ └── Firstred\PostNL\Exception\ShipmentNotFoundException
│ ├── Firstred\PostNL\Exception\HttpClientException
│ └── Firstred\PostNL\Exception\InvalidArgumentException
│ ├── Firstred\PostNL\Exception\InvalidBarcodeException
│ ├── Firstred\PostNL\Exception\InvalidConfigurationException
│ ├── Firstred\PostNL\Exception\InvalidMethodException
│ ├── Firstred\PostNL\Exception\NotImplementedException
│ └── Firstred\PostNL\Exception\NotSupportedException
└── Psr\Cache\InvalidArgumentException
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``.
Binary file added docs/img/postnlphp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 97f2792

Please sign in to comment.