summaryrefslogtreecommitdiff
path: root/discord/http.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'discord/http.cpp')
-rw-r--r--discord/http.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/discord/http.cpp b/discord/http.cpp
index 454324e..696ab30 100644
--- a/discord/http.cpp
+++ b/discord/http.cpp
@@ -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());
+ }
}