MCPcopy Create free account
hub / github.com/ClickHouse/ai-sdk-cpp / APIError

Class APIError

include/ai/errors.h:24–39  ·  view source on GitHub ↗

Error related to API communication

Source from the content-addressed store, hash-verified

22
23/// Error related to API communication
24class APIError : public AIError {
25 private:
26 int status_code_;
27
28 public:
29 APIError(int status_code, const std::string& message)
30 : AIError("API Error (" + std::to_string(status_code) + "): " + message),
31 status_code_(status_code) {}
32
33 int status_code() const { return status_code_; }
34
35 /// Check if the error is retryable based on status code
36 bool is_retryable() const {
37 return ai::is_status_code_retryable(status_code_);
38 }
39};
40
41/// Error related to authentication/authorization
42class AuthenticationError : public APIError {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected