MCPcopy Create free account
hub / github.com/Icinga/icinga2 / printErrorInfo

Function printErrorInfo

plugins/thresholds.cpp:239–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239void printErrorInfo(unsigned long err)
240{
241 if (!err)
242 err = GetLastError();
243 LPWSTR mBuf = NULL;
244 if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
245 NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&mBuf, 0, NULL))
246 std::wcout << "Failed to format error message, last error was: " << err << '\n';
247 else {
248 boost::trim_right(std::wstring(mBuf));
249 std::wcout << mBuf << std::endl;
250 }
251}
252
253std::wstring formatErrorInfo(unsigned long err) {
254 std::wostringstream out;

Callers 10

check_ping4Function · 0.85
check_ping6Function · 0.85
getServiceByDescriptionFunction · 0.85
getServiceStatusFunction · 0.85
check_usersFunction · 0.85
check_updateFunction · 0.85
check_drivesFunction · 0.85
check_loadFunction · 0.85
check_swapFunction · 0.85
check_networkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected