Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _HTTP_ERR_HPP
#define _HTTP_ERR_HPP
#include <string>
#include <exception>
class HttpException : virtual public std::exception
{
public:
enum Type
{
Generic,
SocketOpen,
InvalidIP,
SocketBind,
TcpAccept,
TcpSend
};
protected:
std::string message;
Type error_type;
public:
HttpException(const HttpException::Type &type, const std::string &message);
HttpException(const HttpException::Type &type);
const char * what()
const noexcept override;
const HttpException::Type & getType() const noexcept;
static const char * typeToString(const HttpException::Type & type);
};
#endif // _HTTP_ERR_HPP