|
1 | 1 | Exceptions
|
2 | 2 | ==========
|
3 | 3 |
|
4 |
| -HTTPlug defines one Exception interface: ``Http\Client\Exception``. All HTTP |
5 |
| -client exceptions must implement this interface. |
| 4 | +HTTPlug defines a common interface for all exceptions thrown by HTTPlug implementations. |
| 5 | +Every exception thrown by a HTTP client must implement ``Http\Client\Exception``. |
6 | 6 |
|
7 | 7 | ``HttpClient::sendRequest()`` can throw one of the following exceptions.
|
8 | 8 |
|
9 |
| -================================== ====================== =================== |
10 |
| -Exception Thrown when Methods available |
11 |
| -================================== ====================== =================== |
12 |
| -TransferException ??? |
13 |
| -└ RequestException the request is invalid ``getRequest()`` |
| 9 | +================================== ============================= =================== |
| 10 | +Exception Thrown when Methods available |
| 11 | +================================== ============================= =================== |
| 12 | +TransferException something unexpected happened - |
| 13 | +└ RequestException the request is invalid ``getRequest()`` |
14 | 14 | |nbsp| |nbsp| └ NetworkException no response received
|
15 |
| - due to network issues ``getRequest()`` |
16 |
| - |nbsp| |nbsp| └ HttpException error response ``getRequest()`` |
17 |
| - ``getResponse()`` |
18 |
| -================================== ====================== =================== |
| 15 | + due to network issues ``getRequest()`` |
| 16 | + |nbsp| |nbsp| └ HttpException error response ``getRequest()`` |
| 17 | + ``getResponse()`` |
| 18 | +================================== ============================= =================== |
| 19 | + |
| 20 | +.. note:: |
| 21 | + |
| 22 | + The ``sendAsyncRequest`` should never throw an exception but always return a |
| 23 | + :doc:`../components/promise`. The exception classes used in ``Promise::wait`` and the ``then`` |
| 24 | + callback are however the same as explained here. |
19 | 25 |
|
20 | 26 | .. |nbsp| unicode:: U+00A0 .. non-breaking space
|
0 commit comments