Bridges-C++ 3.5.0-dev1
Bridges(C++ API)
Loading...
Searching...
No Matches
bridges_exception.h
Go to the documentation of this file.
1#ifndef BRIDGESEXP_H
2#define BRIDGESEXP_H
3
4namespace bridges {
5
6 struct RuntimeException : public std::exception {
7
8 std::string what_str;
9
10 RuntimeException() = default;
11 virtual ~RuntimeException() = default;
12
13 virtual const char* what() const noexcept {
14 return what_str.c_str();
15 }
16 };
17
19 std::string url; //URL hit that generated the exception
20 long httpcode; // The returned HTTP code
21 std::string headers; //The headers returned by the HTTP server
22 std::string data; //The data returned by the HTTP server
23
24 HTTPException (std::string url,
25 long httpcode,
26 std::string headers,
27 std::string data)
29 what_str = std::string("HTTPException raised when hitting ") + url + "\n" +
30 "HTTP code: " + to_string(httpcode) + "\n" +
31 headers + "\n" +
32 data;
33 }
34 virtual ~HTTPException() = default;
35 };
36
37}
38
39#endif
Support for drawing Bar charts.
Definition alltypes.h:4
Definition bridges_exception.h:18
std::string url
Definition bridges_exception.h:19
HTTPException(std::string url, long httpcode, std::string headers, std::string data)
Definition bridges_exception.h:24
std::string data
Definition bridges_exception.h:22
std::string headers
Definition bridges_exception.h:21
virtual ~HTTPException()=default
long httpcode
Definition bridges_exception.h:20
Definition bridges_exception.h:6
virtual ~RuntimeException()=default
std::string what_str
Definition bridges_exception.h:8
virtual const char * what() const noexcept
Definition bridges_exception.h:13