Octane API Client
Loading...
Searching...
No Matches
error_response.h
Go to the documentation of this file.
1
11#ifndef OCTANE_API_CLIENT_ERROR_RESPONSE_H_
12#define OCTANE_API_CLIENT_ERROR_RESPONSE_H_
13
14#include <string>
15#include <string_view>
16
17#include "./result.h"
18
19namespace octane {
33 std::string code;
45 std::string reason;
46 };
71 error_t<ErrorResponse> makeError(std::string_view code,
72 std::string_view reason);
73 bool operator==(const ErrorResponse& a, const ErrorResponse& b);
74 std::ostream& operator<<(std::ostream& stream, const ErrorResponse& err);
75} // namespace octane
76#endif // OCTANE_API_CLIENT_ERROR_RESPONSE_H_
Utility class that can be used when we only want to specify quasi-normal state types.
Definition: result.h:310
Definition: api_client.cpp:20
decltype(auto) err(T_Error &&error)
Utility function to construct quasi-normal state values.
Definition: result.h:388
error_t< ErrorResponse > makeError(std::string_view code, std::string_view reason)
Utility function to create error response.
Definition: error_response.cpp:16
std::ostream & operator<<(std::ostream &stream, const HealthResult &healthResult)
Definition: api_result_types.cpp:18
bool operator==(const HealthResult &a, const HealthResult &b)
Definition: api_result_types.cpp:15
Define type to represent the result, inspired by Rust's "Result".
General stucture to represent the error.
Definition: error_response.h:24
std::string code
Error code.
Definition: error_response.h:33
std::string reason
Reason why the error ocurred.
Definition: error_response.h:45