Skip to content

Commit

Permalink
Fix error callback being called twice
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed Nov 17, 2023
1 parent 1391e59 commit 2672cea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wiliwili/include/api/bilibili/util/http.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class HTTP {
[callback, error](const cpr::Response& r) {
if (r.status_code == 0) {
ERROR_MSG("No network connection", -1);
return;
} else if (r.status_code != 200) {
ERROR_MSG("Network error. [Status code: " +
std::to_string(r.status_code) + " ]",
Expand All @@ -77,6 +78,7 @@ class HTTP {
[callback, error](const cpr::Response& r) {
if (r.status_code == 0) {
ERROR_MSG("No network connection", -1);
return;
} else if (r.status_code != 200) {
ERROR_MSG("Network error. [Status code: " +
std::to_string(r.status_code) + " ]",
Expand Down

0 comments on commit 2672cea

Please sign in to comment.