C++ Client-Side SDK
LaunchDarkly SDK
data_source_status_error_info.hpp
1 #pragma once
2 
3 #include <launchdarkly/data_sources/data_source_status_error_kind.hpp>
4 
5 #include <chrono>
6 #include <cstdint>
7 #include <string>
8 
9 namespace launchdarkly::common::data_sources {
10 
15  public:
16  using StatusCodeType = std::uint64_t;
17  using ErrorKind = DataSourceStatusErrorKind;
18  using DateTime = std::chrono::time_point<std::chrono::system_clock>;
19 
23  [[nodiscard]] ErrorKind Kind() const { return kind_; }
24 
28  [[nodiscard]] StatusCodeType StatusCode() const { return status_code_; }
29 
36  [[nodiscard]] std::string const& Message() const { return message_; }
37 
41  [[nodiscard]] DateTime Time() const { return time_; }
42 
43  DataSourceStatusErrorInfo(ErrorKind kind,
44  StatusCodeType status_code,
45  std::string message,
46  DateTime time)
47  : kind_(kind),
48  status_code_(status_code),
49  message_(std::move(message)),
50  time_(time) {}
51 
52  private:
53  ErrorKind kind_;
54  StatusCodeType status_code_;
55  std::string message_;
56  DateTime time_;
57 };
58 
59 std::ostream& operator<<(std::ostream& out,
60  DataSourceStatusErrorInfo const& error);
61 
62 } // namespace launchdarkly::common::data_sources
Definition: data_source_status_error_info.hpp:14
ErrorKind Kind() const
Definition: data_source_status_error_info.hpp:23
DateTime Time() const
Definition: data_source_status_error_info.hpp:41
StatusCodeType StatusCode() const
Definition: data_source_status_error_info.hpp:28
std::string const & Message() const
Definition: data_source_status_error_info.hpp:36