From e3b713b1505308b5b981e2c6d71fa3815b61b9d1 Mon Sep 17 00:00:00 2001 From: gina888666 Date: Tue, 30 Jun 2026 21:12:27 +0800 Subject: [PATCH] fix(config): combine stderr+stdout when detecting auth errors in verify Co-Authored-By: Claude Sonnet 4.6 --- src/commands/config.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/commands/config.ts b/src/commands/config.ts index b3ed5ef..9119f24 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -93,11 +93,10 @@ function verify(): "ok" | "auth_fail" | "network_fail" { execSync("gmgn-cli track follow-wallet --chain sol --limit 1", { stdio: "pipe" }); return "ok"; } catch (e: unknown) { - const output = (() => { - if (e && typeof e === "object" && "stderr" in e) return String((e as { stderr: unknown }).stderr); - if (e && typeof e === "object" && "stdout" in e) return String((e as { stdout: unknown }).stdout); - return String(e); - })(); + const output = [ + (e as any).stderr?.toString() ?? "", + (e as any).stdout?.toString() ?? "", + ].join(" "); if (/401|403|unauthorized|forbidden|invalid.*key|key.*invalid|signature/i.test(output)) { return "auth_fail"; }