Skip to content

Commit f41c077

Browse files
committed
Switched out implementation of http_exception message to reuse windows_category from asyncrt_utils
1 parent a9861cb commit f41c077

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

Release/src/http/client/http_win7.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,8 @@ static std::string build_callback_error_msg(_In_ WINHTTP_ASYNC_RESULT *error_res
128128
error_msg << "Unknown WinHTTP Function";
129129
break;
130130
}
131-
error_msg << ": " << error_result->dwError << ": ";
132-
std::array<char, 256> buf = { 0 };
133-
134-
auto hr = ::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
135-
NULL,
136-
error_result->dwError,
137-
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
138-
buf.data(),
139-
buf.size() - 1,
140-
NULL);
141-
if (hr == 0)
142-
error_msg << buf.data();
143-
else
144-
error_msg << "?";
131+
error_msg << ": " << error_result->dwError << ": "
132+
<< utility::details::windows_category().message(error_result->dwError);
145133
return error_msg.str();
146134
}
147135

0 commit comments

Comments
 (0)