Exception for HTTP errors.
More...
#include <exceptions.hpp>
|
| HTTPException (const uint16_t code) |
| Constructor with error code. More...
|
|
| HTTPException (const uint16_t code, string_view error_message) |
| Constructor with error code and error message. More...
|
|
const char * | what () const noexcept override |
| Returns error message. More...
|
|
Exception for HTTP errors.
- Since
- 0.1.0
◆ HTTPException() [1/2]
pornsieve::HTTPException::HTTPException |
( |
const uint16_t |
code | ) |
|
|
inlineexplicit |
Constructor with error code.
- Since
- 0.1.0
◆ HTTPException() [2/2]
pornsieve::HTTPException::HTTPException |
( |
const uint16_t |
code, |
|
|
string_view |
error_message |
|
) |
| |
|
inlineexplicit |
Constructor with error code and error message.
- Since
- 0.1.0
103 , _error_message{error_message}
◆ what()
const char * pornsieve::HTTPException::what |
( |
| ) |
const |
|
overridenoexcept |
Returns error message.
- Since
- 0.1.0
46 static string error_string;
47 error_string = _error_message;
48 if (!error_string.empty())
50 error_string =
" – " + error_string;
52 error_string = format(
"HTTP error: {:d}{:s}",
error_code, error_string);
53 return error_string.c_str();
◆ error_code
const uint16_t pornsieve::HTTPException::error_code |
The documentation for this class was generated from the following files: