Skip to content

Commit e145ec8

Browse files
committed
sea: print error information when fs operations fail
1 parent 68d7b6f commit e145ec8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/node_sea_bin.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,10 @@ ExitCode BuildSingleExecutable(const std::string& sea_config_path,
395395
uv_fs_t req;
396396
int r = uv_fs_stat(nullptr, &req, config.executable_path.c_str(), nullptr);
397397
if (r != 0) {
398-
FPrintF(
399-
stderr, "Error: Couldn't stat executable %s\n", config.executable_path);
398+
FPrintF(stderr,
399+
"Error: Couldn't stat executable %s: %s\n",
400+
config.executable_path,
401+
uv_strerror(r));
400402
uv_fs_req_cleanup(&req);
401403
return ExitCode::kGenericUserError;
402404
}
@@ -406,8 +408,10 @@ ExitCode BuildSingleExecutable(const std::string& sea_config_path,
406408
std::string exe;
407409
r = ReadFileSync(&exe, config.executable_path.c_str());
408410
if (r != 0) {
409-
FPrintF(
410-
stderr, "Error: Couldn't read executable %s\n", config.executable_path);
411+
FPrintF(stderr,
412+
"Error: Couldn't read executable %s: %s\n",
413+
config.executable_path,
414+
uv_strerror(r));
411415
return ExitCode::kGenericUserError;
412416
}
413417

0 commit comments

Comments
 (0)