src/HTTPClient.h
branchv_0
changeset 11 6b913e82f52a
parent 9 9fdbfbe24161
equal deleted inserted replaced
10:479557122717 11:6b913e82f52a
    66 		std::vector<std::string> headers;
    66 		std::vector<std::string> headers;
    67 		std::string body;
    67 		std::string body;
    68 	};
    68 	};
    69 
    69 
    70 	class Exception : public std::runtime_error {
    70 	class Exception : public std::runtime_error {
       
    71 	private:
       
    72 		std::string details;
    71 	public:
    73 	public:
       
    74 
       
    75 		Exception(const std::string& message, const std::string& details) : runtime_error(message), details(details) {
       
    76 		}
    72 
    77 
    73 		Exception(const std::string& message) : runtime_error(message) {
    78 		Exception(const std::string& message) : runtime_error(message) {
    74 		}
    79 		}
    75 
    80 
    76 		Exception(const char* message) : runtime_error(message) {
    81 		Exception(const char* message) : runtime_error(message) {
    77 		}
    82 		}
    78 
    83 
       
    84 		std::string getDetails() const {
       
    85 			return details;
       
    86 		}
       
    87 		
       
    88 		std::string getFullMessage() const {
       
    89 			return std::string(what()) + ": " + details;
       
    90 		}
    79 	};
    91 	};
    80 
    92 
    81 	virtual ~HTTPClient();
    93 	virtual ~HTTPClient();
    82 	HTTPClient(const HTTPClient&) = delete;
    94 	HTTPClient(const HTTPClient&) = delete;
    83 	HTTPClient& operator=(const HTTPClient&) = delete;
    95 	HTTPClient& operator=(const HTTPClient&) = delete;