LeftHookRoll
An HTTP/1.0 compliant web server, as specified by RFC1945
Loading...
Searching...
No Matches
FatalExceptions.hpp
Go to the documentation of this file.
1/** @file FatalExceptions.hpp
2 * @brief This class will be used to collect *fatal* exceptions, which are exceptions that should cause the program to exit immediately.
3 * any exception that can be recovered from/used to control flow SHOULD NOT be in this file, and rather should be a subclass of it's cause class.
4*/
5#pragma once
6
7#include <exception>
8#include <string>
9
10class FatalException : public std::exception
11{
12 public:
13 FatalException(const std::string& msg);
14 FatalException(const FatalException& other);
16 virtual ~FatalException() throw();
17
18 virtual const char* what() const throw();
19
20 private:
21 std::string _msg;
22};
23
24/**
25 * @brief Exception type for failures scoped to a single client request.
26 *
27 * Throw this from request/response/CGI runtime paths when the server stays
28 * operable and the connection should produce an HTTP error response.
29 */
30class ClientException : public std::exception
31{
32 public:
33 ClientException(int statusCode, const std::string& msg);
34 ClientException(const ClientException& other);
36 virtual ~ClientException() throw();
37
38 virtual const char* what() const throw();
39 int getStatusCode() const;
40
41 private:
43 std::string _msg;
44};
Exception type for failures scoped to a single client request.
virtual const char * what() const
virtual ~ClientException()
int getStatusCode() const
ClientException & operator=(const ClientException &other)
virtual ~FatalException()
virtual const char * what() const
FatalException & operator=(const FatalException &other)