diff --git a/src/RageUtil/Graphics/RageDisplay_D3D.cpp b/src/RageUtil/Graphics/RageDisplay_D3D.cpp index 8f07ab5602..fcf58ba012 100644 --- a/src/RageUtil/Graphics/RageDisplay_D3D.cpp +++ b/src/RageUtil/Graphics/RageDisplay_D3D.cpp @@ -133,11 +133,19 @@ const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr ) auto GetErrorString(HRESULT hr) -> std::string { + Locator::getLogger()->warn("RageDisplay_D3D::GetErrorString() - HR {}", + static_cast(hr)); const wchar_t* msg = DXGetErrorStringW(hr); if (msg) { - return WStringToString(std::wstring(msg)); + auto r = WStringToString(std::wstring(msg)); + if (r.compare("Unknown error.") == 0) { + return fmt::format("Unknown error: HR {}", static_cast(hr)); + } else { + return r; + } } else { - return fmt::format("Unknown error: HR {}", static_cast(hr)); + return fmt::format("Failed to read error: HR {}", + static_cast(hr)); } }