-
Notifications
You must be signed in to change notification settings - Fork 0
/
errorMessage.hpp
44 lines (40 loc) · 1.82 KB
/
errorMessage.hpp
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
40
41
42
43
44
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* errorMessage.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: eej-jama <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/19 15:27:57 by hlakhal- #+# #+# */
/* Updated: 2024/02/13 18:13:42 by eej-jama ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef ERROR_MESSAGE_HPP
#define ERROR_MESSAGE_HPP
#include <iostream>
#include <stdexcept>
#include <sstream>
#include<map>
class errorMessage : public std::exception
{
public:
errorMessage();
errorMessage(int status, std::string& path, bool isCgi = false) throw();
errorMessage(int status, std::string& path, std::string& type) throw();
errorMessage(int status, int ind, const std::string& type = "text/html") throw();
errorMessage(int status, int ind, int posLocation) throw();
int getStatusCode() const;
const std::string& getType() const;
const std::string& getBody() const;
bool getCgiStatus() const;
virtual const char* what() const throw();
virtual ~errorMessage() throw();
protected:
std::string message;
int status_code;
bool isCgi;
std::string type;
std::string body;
std::map<int, std::string> error;
};
#endif