mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-06 20:15:19 +03:00
handle http errors a bit better
This commit is contained in:
@@ -100,5 +100,9 @@ void HTTPClient::CleanupFutures() {
|
||||
|
||||
void HTTPClient::OnResponse(cpr::Response r, std::function<void(cpr::Response r)> cb) {
|
||||
CleanupFutures();
|
||||
cb(r);
|
||||
try {
|
||||
cb(r);
|
||||
} catch (std::exception &e) {
|
||||
fprintf(stderr, "error handling response (%s, code %d): %s\n", r.url.c_str(), r.status_code, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user