mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Report CNG error codes in hex (#16465)
This commit is contained in:
committed by
GitHub
parent
9d29de1444
commit
98114c91c6
@@ -14,6 +14,7 @@
|
||||
# include "../platform/Platform2.h"
|
||||
# include "IStream.hpp"
|
||||
|
||||
# include <iomanip>
|
||||
# include <sstream>
|
||||
# include <stdexcept>
|
||||
# include <string>
|
||||
@@ -34,7 +35,9 @@ static void CngThrowOnBadStatus(std::string_view name, NTSTATUS status)
|
||||
{
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
throw std::runtime_error(std::string(name) + " failed: " + std::to_string(status));
|
||||
std::stringstream stream;
|
||||
stream << "0x" << std::setfill('0') << std::setw(8) << std::hex << status;
|
||||
throw std::runtime_error(std::string(name) + " failed: " + stream.str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user