diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-09-05 20:59:17 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-09-05 20:59:17 -0400 |
commit | 8e749ac3bf048d2790496d2e8d23da476c56ff55 (patch) | |
tree | e02e58ea61b3bf49eab297364489dfe9cb952749 /discord/http.cpp | |
parent | 5e0a5bb964a54c396186c36a11ec56c788f03082 (diff) | |
download | abaddon-portaudio-8e749ac3bf048d2790496d2e8d23da476c56ff55.tar.gz abaddon-portaudio-8e749ac3bf048d2790496d2e8d23da476c56ff55.zip |
handle http errors a bit better
Diffstat (limited to 'discord/http.cpp')
-rw-r--r-- | discord/http.cpp | 6 |
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()); + } } |