[PR #37] [CLOSED] fix(cli): throw Error on timeout aborts #224

Closed
opened 2026-02-15 17:16:22 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/clawhub/pull/37
Author: @zats
Created: 1/25/2026
Status: Closed

Base: mainHead: fix/cli-timeout


📝 Commits (2)

  • f500c73 fix(cli): throw Error on timeout aborts
  • 8665d44 fix(http): wrap fetch calls in try-finally to prevent timer leaks

📊 Changes

2 files changed (+49 additions, -40 deletions)

View changed files

📝 e2e/clawdhub.e2e.test.ts (+1 -1)
📝 packages/clawdhub/src/http.ts (+48 -39)

📄 Description

Summary

  • abort timeouts with Error objects so retries/logging treat them as real errors
  • align the e2e timeout helper with the same Error-based aborts

Rationale

  • Users are seeing noisy CLI failures like: “Non-error was thrown: "Timeout".” That comes from aborting with a string, which p-retry treats as a non-Error. Switching to Error preserves the same timeout behavior while making the failure type correct and the message actionable.

Testing

  • bun run lint (pass)
  • bun run test -- packages/clawdhub (pass)

Before

$ node dist/cli.js search image
❌ Non-error was thrown: "Timeout". You should only throw errors.

After

$ node dist/cli.js search image
table-image v1.0.0  Table Image  (0.332)
nano-banana-pro v1.0.1  Nano Banana Pro  (0.319)
vap-media v1.0.1  AI media generation API - Flux2pro, Veo3.1, Suno Ai  (0.281)
clawdbot-meshyai-skill v0.1.0  Meshy AI  (0.276)
venice-ai-media v1.0.0  Venice AI Media  (0.274)
daily-recap v1.0.2  Daily Recap  (0.260)
openai-image-gen v1.0.1  Openai Image Gen  (0.260)
bible-votd v1.0.1  Bible Verse of the Day  (0.248)
orf v1.0.1  ORF  (0.224)
smalltalk v1.0.1  Smalltalk  (0.161)

P.S. PR looks way less scary if you disable whitespace changes 🙂


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/clawhub/pull/37 **Author:** [@zats](https://github.com/zats) **Created:** 1/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/cli-timeout` --- ### 📝 Commits (2) - [`f500c73`](https://github.com/openclaw/clawhub/commit/f500c733729e3a08a791069e86c86a4952e7b698) fix(cli): throw Error on timeout aborts - [`8665d44`](https://github.com/openclaw/clawhub/commit/8665d447386c3d12de817904466729ba37efdf14) fix(http): wrap fetch calls in try-finally to prevent timer leaks ### 📊 Changes **2 files changed** (+49 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `e2e/clawdhub.e2e.test.ts` (+1 -1) 📝 `packages/clawdhub/src/http.ts` (+48 -39) </details> ### 📄 Description ## Summary - abort timeouts with Error objects so retries/logging treat them as real errors - align the e2e timeout helper with the same Error-based aborts ## Rationale - Users are seeing noisy CLI failures like: “Non-error was thrown: \"Timeout\".” That comes from aborting with a string, which p-retry treats as a non-Error. Switching to `Error` preserves the same timeout behavior while making the failure type correct and the message actionable. ## Testing - bun run lint (pass) - bun run test -- packages/clawdhub (pass) ## Before ```bash $ node dist/cli.js search image ❌ Non-error was thrown: "Timeout". You should only throw errors. ``` ## After ```bash $ node dist/cli.js search image table-image v1.0.0 Table Image (0.332) nano-banana-pro v1.0.1 Nano Banana Pro (0.319) vap-media v1.0.1 AI media generation API - Flux2pro, Veo3.1, Suno Ai (0.281) clawdbot-meshyai-skill v0.1.0 Meshy AI (0.276) venice-ai-media v1.0.0 Venice AI Media (0.274) daily-recap v1.0.2 Daily Recap (0.260) openai-image-gen v1.0.1 Openai Image Gen (0.260) bible-votd v1.0.1 Bible Verse of the Day (0.248) orf v1.0.1 ORF (0.224) smalltalk v1.0.1 Smalltalk (0.161) ``` P.S. PR looks way less scary if you disable whitespace changes 🙂 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:16:22 -05:00
yindo closed this issue 2026-02-15 17:16:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#224