diff options
| author | Dan Engelbrecht <[email protected]> | 2025-08-12 13:53:58 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-08-12 13:53:58 +0200 |
| commit | 3a9bc3071b9a9452a5aef23c438233fc9e86fb47 (patch) | |
| tree | b0a1d67fe765f2ddc96772db088d781be159d627 /src/zenhttp/include | |
| parent | add filtering to builds download (#463) (diff) | |
| download | zen-3a9bc3071b9a9452a5aef23c438233fc9e86fb47.tar.xz zen-3a9bc3071b9a9452a5aef23c438233fc9e86fb47.zip | |
use new builds api for oplogs (#464)
- Improvement: Refactored jupiter oplog export code to reuse builds jupiter wrapper classes
- Improvement: If `zen builds`, `zen oplog-import` or `zen oplog-import` command fails due to a http error, the return code for the program will be set to the error/status code
Diffstat (limited to 'src/zenhttp/include')
| -rw-r--r-- | src/zenhttp/include/zenhttp/httpclient.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/zenhttp/include/zenhttp/httpclient.h b/src/zenhttp/include/zenhttp/httpclient.h index c991a71ea..50bd5b53a 100644 --- a/src/zenhttp/include/zenhttp/httpclient.h +++ b/src/zenhttp/include/zenhttp/httpclient.h @@ -57,6 +57,29 @@ struct HttpClientSettings uint8_t RetryCount = 0; }; +class HttpClientError : public std::runtime_error +{ +public: + using _Mybase = runtime_error; + + HttpClientError(const std::string& Message, int Error, HttpResponseCode ResponseCode) + : _Mybase(Message) + , m_Error(Error) + , m_ResponseCode(ResponseCode) + { + } + + HttpClientError(const char* Message, int Error, HttpResponseCode ResponseCode) + : _Mybase(Message) + , m_Error(Error) + , m_ResponseCode(ResponseCode) + { + } + + const int m_Error = 0; + const HttpResponseCode m_ResponseCode = HttpResponseCode::ImATeapot; +}; + class HttpClient { public: |