LeftHookRoll
An HTTP/1.0 compliant web server, as specified by RFC1945
Loading...
Searching...
No Matches
FatalExceptions.cpp
Go to the documentation of this file.
1#include "../includes/FatalExceptions.hpp"
2
3FatalException::FatalException(const std::string& msg) : _msg(msg) {}
4
5FatalException::FatalException(const FatalException& other) : std::exception(other), _msg(other._msg) {}
6
8{
9 if (this != &other)
10 _msg = other._msg;
11 return *this;
12}
13
15
16const char* FatalException::what() const throw()
17{
18 return _msg.c_str();
19}
20
21ClientException::ClientException(int statusCode, const std::string& msg)
22 : _statusCode(statusCode), _msg(msg) {}
23
25 : std::exception(other), _statusCode(other._statusCode), _msg(other._msg) {}
26
28{
29 if (this != &other)
30 {
32 _msg = other._msg;
33 }
34 return *this;
35}
36
38
39const char* ClientException::what() const throw()
40{
41 return _msg.c_str();
42}
43
45{
46 return _statusCode;
47}
Exception type for failures scoped to a single client request.
virtual const char * what() const
virtual ~ClientException()
ClientException(int statusCode, const std::string &msg)
int getStatusCode() const
ClientException & operator=(const ClientException &other)
virtual ~FatalException()
FatalException(const std::string &msg)
virtual const char * what() const
FatalException & operator=(const FatalException &other)