Error related to API communication
| 22 | |
| 23 | /// Error related to API communication |
| 24 | class 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 |
| 42 | class AuthenticationError : public APIError { |
nothing calls this directly
no outgoing calls
no test coverage detected