Call this when you made a windows DLL call or something that does SetLastError and you get an unexpected error.
pub fn unexpectedError(err: Win32Error) UnexpectedError
pub fn unexpectedError(err: Win32Error) UnexpectedError {
@branchHint(.cold);
if (std.options.unexpected_error_tracing) {
std.debug.print("error.Unexpected: GetLastError({d}): {t}\n", .{ err, err });
std.debug.dumpCurrentStackTrace(.{ .first_address = @returnAddress() });
}
return error.Unexpected;
}