Skip to content

Commit 97f2792

Browse files
committed
Add docs logo
1 parent 7fd2915 commit 97f2792

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

docs/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@
115115
# Theme options are theme-specific and customize the look and feel of a theme
116116
# further. For a list of options available for each theme, see the
117117
# documentation.
118+
html_logo = 'img/postnlphp.png'
119+
html_theme_options = {
120+
'logo_only': True,
121+
'display_version': True,
122+
}
118123
#html_theme_options = {}
119124

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

144149
# Add any extra paths that contain custom files (such as robots.txt or
145150
# .htaccess) here, relative to this directory. These files are copied

docs/exceptionhandling.rst

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,54 @@
33
==================
44
Exception handling
55
==================
6+
7+
**Tree View**
8+
9+
The following tree view describes how the exceptions used in this library depend
10+
on each other.
11+
12+
.. code-block:: none
13+
14+
. \Exception
15+
├── Firstred\PostNL\Exception\PostNLException
16+
│ ├── Firstred\PostNL\Exception\ApiException
17+
│ │ ├── Firstred\PostNL\Exception\ApiConnectionException
18+
│ │ ├── Firstred\PostNL\Exception\CifDownException
19+
│ │ ├── Firstred\PostNL\Exception\CifException
20+
│ │ ├── Firstred\PostNL\Exception\NotFoundException
21+
│ │ ├── Firstred\PostNL\Exception\ResponseException
22+
│ │ └── Firstred\PostNL\Exception\ShipmentNotFoundException
23+
│ ├── Firstred\PostNL\Exception\HttpClientException
24+
│ └── Firstred\PostNL\Exception\InvalidArgumentException
25+
│ ├── Firstred\PostNL\Exception\InvalidBarcodeException
26+
│ ├── Firstred\PostNL\Exception\InvalidConfigurationException
27+
│ ├── Firstred\PostNL\Exception\InvalidMethodException
28+
│ ├── Firstred\PostNL\Exception\NotImplementedException
29+
│ └── Firstred\PostNL\Exception\NotSupportedException
30+
└── Psr\Cache\InvalidArgumentException
31+
32+
Guzzle throws exceptions for errors that occur during a transfer.
33+
34+
- In the event of a networking error (connection timeout, DNS errors, etc.),
35+
a ``GuzzleHttp\Exception\RequestException`` is thrown. This exception
36+
extends from ``GuzzleHttp\Exception\TransferException``. Catching this
37+
exception will catch any exception that can be thrown while transferring
38+
requests.
39+
40+
.. code-block:: php
41+
42+
use GuzzleHttp\Psr7;
43+
use GuzzleHttp\Exception\RequestException;
44+
45+
try {
46+
$client->request('GET', 'https://github.com/_abc_123_404');
47+
} catch (RequestException $e) {
48+
echo Psr7\Message::toString($e->getRequest());
49+
if ($e->hasResponse()) {
50+
echo Psr7\Message::toString($e->getResponse());
51+
}
52+
}
53+
54+
- A ``GuzzleHttp\Exception\ConnectException`` exception is thrown in the
55+
event of a networking error. This exception extends from
56+
``GuzzleHttp\Exception\TransferException``.

docs/img/postnlphp.png

57.8 KB
Loading

0 commit comments

Comments
 (0)