@haystackeditor/cli 0.14.3 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/setup.js +9 -2
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/commands/setup.js
CHANGED
|
@@ -521,9 +521,16 @@ async function runUnifiedScan(repo, token) {
|
|
|
521
521
|
try {
|
|
522
522
|
statusResp = await fetch(`${HAYSTACK_API}/api/onboarding/scan/status?runId=${encodeURIComponent(runId)}`, { headers: { Authorization: `Bearer ${token}` } });
|
|
523
523
|
}
|
|
524
|
-
catch {
|
|
524
|
+
catch (err) {
|
|
525
525
|
// Transient network blip — the KV state is authoritative and won't vanish
|
|
526
|
-
// from one failed poll, so keep going.
|
|
526
|
+
// from one failed poll, so keep going. Record it (non-disruptive, no
|
|
527
|
+
// terminal noise) so a persistently-failing poll isn't invisible
|
|
528
|
+
// (PR001: no silent failure).
|
|
529
|
+
trackError('onboarding_scan_poll_network_error', {
|
|
530
|
+
repo,
|
|
531
|
+
run_id: runId,
|
|
532
|
+
error_message: err instanceof Error ? err.message : String(err),
|
|
533
|
+
});
|
|
527
534
|
continue;
|
|
528
535
|
}
|
|
529
536
|
if (statusResp.status === 404) {
|
package/dist/index.js
CHANGED
|
@@ -45,7 +45,11 @@ function getVersion() {
|
|
|
45
45
|
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json');
|
|
46
46
|
return JSON.parse(readFileSync(pkgPath, 'utf8')).version ?? '0.0.0';
|
|
47
47
|
}
|
|
48
|
-
catch {
|
|
48
|
+
catch (err) {
|
|
49
|
+
// package.json ships inside the npm tarball, so this should never happen —
|
|
50
|
+
// but log to stderr instead of silently reporting a wrong version
|
|
51
|
+
// (PR001: no silent fallback). stderr keeps the stdout `--version` clean.
|
|
52
|
+
console.error('haystack: could not read version from package.json:', err instanceof Error ? err.message : err);
|
|
49
53
|
return '0.0.0';
|
|
50
54
|
}
|
|
51
55
|
}
|