Skip to content

Commit

Permalink
Debug zip on unpack failure
Browse files Browse the repository at this point in the history
  • Loading branch information
zziger committed Nov 8, 2023
1 parent b00dfb3 commit 9cccdb5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions client/src/coreclr/CoreClrValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ void CoreClr::DownloadRuntime(alt::IHttpClient* httpClient, Progress& progress)
return;
} catch (std::runtime_error& e) {
cs::Log::Error << "Failed to extract zip: " << e.what() << cs::Log::Endl;

auto path = GetDataDirectoryPath() / "runtime.zip";
try
{
cs::Log::Info << "Writing debug ZIP to: " << path.string() << cs::Log::Endl;
std::ofstream os(path);
os << response.body;
os.close();
cs::Log::Info << "Writing debug ZIP finished" << cs::Log::Endl;
} catch(std::runtime_error& e)
{
cs::Log::Info << "Writing debug ZIP failed: " << e.what() << cs::Log::Endl;
}
}
}
}
Expand Down

0 comments on commit 9cccdb5

Please sign in to comment.