Skip to content

Commit

Permalink
src,test: update snapshot failure in node.cc and associated test
Browse files Browse the repository at this point in the history
  • Loading branch information
debadree25 committed Feb 19, 2023
1 parent 7b22b42 commit f4f6b6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,7 @@ ExitCode LoadSnapshotDataAndRun(const SnapshotData** snapshot_data_ptr,
FILE* fp = fopen(filename.c_str(), "rb");
if (fp == nullptr) {
fprintf(stderr, "Cannot open %s", filename.c_str());
// TODO(joyeecheung): should be kStartupSnapshotFailure.
exit_code = ExitCode::kGenericUserError;
exit_code = ExitCode::kStartupSnapshotFailure;
return exit_code;
}
std::unique_ptr<SnapshotData> read_data = std::make_unique<SnapshotData>();
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-snapshot-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const entry = fixtures.path('snapshot', 'error.js');
console.log(child.status);
console.log(stderr);
console.log(child.stdout.toString());
assert.strictEqual(child.status, 1);
assert.strictEqual(child.status, 14);
assert.match(stderr, /Cannot open/);
assert(!fs.existsSync(path.join(tmpdir.path, 'snapshot.blob')));
}
Expand Down

0 comments on commit f4f6b6b

Please sign in to comment.