-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrorReader.h
More file actions
27 lines (18 loc) · 729 Bytes
/
Copy pathErrorReader.h
File metadata and controls
27 lines (18 loc) · 729 Bytes
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
#ifndef ERRORREADER_H
#define ERRORREADER_H
#include <string>
#include "DataReader.h"
class ErrorReader : public DataReader
{
public:
// If "extraMessage" is set, it will be appended to the message body, which is normally jsut the error status.
// If "extraHeaders" is set, they'll be appended to the message headers. Note that they must be terminated properly
// with '\r\n' at the end of each line.
ErrorReader(int httpErrorCode, const std::string& extraMsg = "", const std::string& extraHeaders = "");
virtual ~ErrorReader();
virtual size_t read(std::string& buffer, const size_t maxBytesToRead);
static std::string getErrorMessage(int httpErrorCode);
private:
std::string m_dataBuffer;
};
#endif