10Duke Scale C++ Client
Loading...
Searching...
No Matches
HTTPResponseToAPIException.h
1#ifndef TENDUKE_SE_HTTPRESPONSETOAPIEXCEPTION_H
2#define TENDUKE_SE_HTTPRESPONSETOAPIEXCEPTION_H
3
4#include "http/HTTPResponseToException.h"
5#include "json/JSONParser.h"
6
7#include <memory>
8
9namespace tenduke { namespace se { namespace http {
10
15{
16public:
21 explicit HTTPResponseToAPIException(const std::shared_ptr<const tenduke::json::JSONParser> &parseJson);
22
23protected:
28 void from4xx(tenduke::http::HTTPResponse &response) const override;
29
34 void from5xx(tenduke::http::HTTPResponse &response) const override;
35
36private:
37 const std::shared_ptr<const tenduke::json::JSONParser> parseJSON;
38};
39
40}}}
41
42#endif //TENDUKE_SE_HTTPRESPONSETOAPIEXCEPTION_H
Utility service to throw an exception based on tenduke::http::HTTPResponse.
Definition HTTPResponseToException.h:18
A HTTP Response.
Definition HTTPResponse.h:15
10Duke Scale specific service for mapping HTTP responses to exceptions.
Definition HTTPResponseToAPIException.h:15
void from5xx(tenduke::http::HTTPResponse &response) const override
Throws appropriate exceptions, when HTTP status code is 5xx.
Definition HTTPResponseToAPIException.cpp:64
void from4xx(tenduke::http::HTTPResponse &response) const override
Throws appropriate exceptions, when HTTP status code is 4xx.
Definition HTTPResponseToAPIException.cpp:21
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7