mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
tools: improve error handling in node_mksnapshot
PR-URL: https://github.com/nodejs/node/pull/59437 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
14c68e3b53
commit
840d05f8ff
|
|
@ -66,8 +66,16 @@ int BuildSnapshot(int argc, char* argv[]) {
|
|||
std::vector<std::string>(argv, argv + argc),
|
||||
node::ProcessInitializationFlags::kGeneratePredictableSnapshot);
|
||||
|
||||
if (result->exit_code() != 0) {
|
||||
for (const std::string& error : result->errors()) {
|
||||
std::cerr << error << "\n";
|
||||
}
|
||||
std::cerr << "node_mksnapshot failed with exit code " << result->exit_code()
|
||||
<< "\n";
|
||||
return static_cast<int>(result->exit_code());
|
||||
}
|
||||
|
||||
CHECK(!result->early_return());
|
||||
CHECK_EQ(result->exit_code(), 0);
|
||||
|
||||
std::string out_path;
|
||||
std::optional<std::string_view> builder_script_path = std::nullopt;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user