continue-custom/core/llm/utils
Keita A. af4383f6df
refactor: unify AbortError detection with isAbortError utility (#10551)
* refactor: unify AbortError detection with isAbortError utility

AbortError detection was scattered across 3+ patterns (string
comparison, .name check, .code check). Consolidates into a single
isAbortError() utility that handles all known patterns: "cancel"
string, DOMException, Error.name variants, ABORT_ERR code, and
plain objects. Updates call sites in core/llm/index.ts and
core/llm/utils/retry.ts.

* fix: use exact match for AbortError name, add null guard, improve tests

- Changed .includes("AbortError") to === "AbortError" to preserve
  original exact-match semantics at L505 and retry.ts call sites
- Added null/undefined early return to prevent TypeError on
  "name" in null
- Unified DOMException branch to use exact match consistently
- Tests: removed 4 redundant same-branch duplicates, added 12 new
  cases (case sensitivity, empty string, non-string name, partial
  name boundary, DOMException negative, plain object code asymmetry,
  boolean, frozen object, Error subclass, TypeError)
- Fixed DOMException test skip from expect(true).toBe(true) to
  it.skipIf

* fix: replace == null with === null || === undefined (eqeqeq)

---------

Co-authored-by: amabito <192487536+amabito@users.noreply.github.com>
Co-authored-by: amabito <amabito@local>
2026-03-13 16:10:05 -07:00
..
calculateRequestCost.ts fix: update stale comment for Claude Opus 4.5 pricing 2026-02-18 01:23:22 +00:00
calculateRequestCost.vitest.ts Add comprehensive cost tracking with OpenAI pricing and session usage display 2025-12-05 15:23:21 -08:00
extractContentFromCodeBlocks.test.ts fix: formatting 2025-06-20 11:24:06 -07:00
extractContentFromCodeBlocks.ts improv: tests 2025-06-20 09:30:00 -07:00
extractPathsFromCodeBlocks.test.ts npx prettier --check "core/**/*.{js,jsx,ts,tsx,json,css,md}" --ignore-p 2025-05-25 18:34:39 -07:00
extractPathsFromCodeBlocks.ts switch to the free trial assistant once logged in for the first time 2025-06-08 13:44:44 -07:00
getSecureID.test.ts fix: HOTFIX 🚑 Fix crypto error (#7938) 2025-09-24 13:06:58 -07:00
getSecureID.ts fix: HOTFIX 🚑 Fix crypto error (#7938) 2025-09-24 13:06:58 -07:00
retry.test.ts fix: detect embedded 429 errors from Gemini/VertexAI APIs 2026-02-20 00:30:46 -08:00
retry.ts refactor: unify AbortError detection with isAbortError utility (#10551) 2026-03-13 16:10:05 -07:00
starterCredits.ts feat: rehaul onboarding for updated billing (#7965) 2025-10-12 20:50:16 -07:00