mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-03 12:18:11 +08:00
use operator<< to convert ReqResult to string (#1126)
This commit is contained in:
parent
6b677a3ff6
commit
080123ff96
@ -341,17 +341,10 @@ inline void internal::HttpRespAwaiter::await_suspend(
|
||||
setValue(resp);
|
||||
else
|
||||
{
|
||||
std::string reason;
|
||||
if (result == ReqResult::BadResponse)
|
||||
reason = "BadResponse";
|
||||
else if (result == ReqResult::NetworkFailure)
|
||||
reason = "NetworkFailure";
|
||||
else if (result == ReqResult::BadServerAddress)
|
||||
reason = "BadServerAddress";
|
||||
else if (result == ReqResult::Timeout)
|
||||
reason = "Timeout";
|
||||
std::stringstream ss;
|
||||
ss << result;
|
||||
setException(
|
||||
std::make_exception_ptr(std::runtime_error(reason)));
|
||||
std::make_exception_ptr(std::runtime_error(ss.str())));
|
||||
}
|
||||
handle.resume();
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user