From e9013636f69c9f2d18a405ef2f98a14d80446d22 Mon Sep 17 00:00:00 2001 From: Danil Pismenny Date: Fri, 13 Mar 2026 10:54:02 +0300 Subject: [PATCH] fix: log error in isCliEntrypoint empty catch block Replace silent catch {} with error logging to stderr before falling back to path.resolve(), preventing realpathSync failures from being silently swallowed during startup. Closes #20 Co-Authored-By: Claude Opus 4.6 --- cli.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli.js b/cli.js index 7935b44..d37e360 100755 --- a/cli.js +++ b/cli.js @@ -3971,7 +3971,8 @@ function isCliEntrypoint(argvPath = process.argv[1]) { } try { return pathToFileURL(fs.realpathSync(argvPath)).href === import.meta.url; - } catch { + } catch (error) { + process.stderr.write(`isCliEntrypoint: realpathSync failed for ${argvPath}: ${error.message}\n`); return pathToFileURL(path.resolve(argvPath)).href === import.meta.url; } }