Added error code 12

This commit is contained in:
tastytea 2018-02-27 02:03:44 +01:00
parent 805384ca0b
commit 9bc6e401aa
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
3 changed files with 9 additions and 2 deletions

View File

@ -78,6 +78,7 @@ After you did a `make install`, a project consisting of one file can be compiled
| 4 | Aborted by user |
| 10 | Failed to connect |
| 11 | Couldn't resolve host |
| 12 | Network is unreachable |
| 100 - 999 | HTTP status codes |
| 65535 | Unknown error |

View File

@ -151,6 +151,11 @@ const std::uint16_t API::http::request_sync(const method &meth,
{
ret = 11;
}
else if (std::strncmp(e.what(),
"Network is unreachable", 22) == 0)
{
ret = 12;
}
else
{
cerr << "RUNTIME ERROR: " << e.what() << std::endl;

View File

@ -49,8 +49,9 @@ namespace Mastodon
* | 2 | Not implemented |
* | 3 | URL changed (HTTP 301 or 308) |
* | 4 | Aborted by user |
* | 10 | Failed to connect |
* | 11 | Couldn't resolve host |
* | 10 | Failed to connect |
* | 11 | Couldn't resolve host |
* | 12 | Network is unreachable |
* | 100 - 999 | HTTP status codes |
* | 65535 | Unknown exception |
*/