fix: propagate InputError instead of returning empty array#3995
fix: propagate InputError instead of returning empty array#3995pullfrog[bot] wants to merge 3 commits into
Conversation
When the input file is missing, generate.ts was catching InputError, printing the error, and returning [] instead of re-throwing. The CLI's .action() handler then saw an empty context and called process.exit(0), masking the failure from CI tooling. Fix: change `if (inputError) return []` to `if (inputError) throw error` in both openapi-ts and openapi-python generate.ts files.
|
|
🦋 Changeset detectedLatest commit: b771dae The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3995 +/- ##
=======================================
Coverage 39.07% 39.08%
=======================================
Files 610 610
Lines 21561 21560 -1
Branches 6348 6361 +13
=======================================
Hits 8426 8426
Misses 10697 10697
+ Partials 2438 2437 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
@hey-api/codegen-core
@hey-api/json-schema-ref-parser
@hey-api/nuxt
@hey-api/openapi-ts
@hey-api/shared
@hey-api/spec-types
@hey-api/types
@hey-api/vite-plugin
commit: |
|
@pullfrog can you locate the commit/pull request where we previously added this handling for input errors? It seems very deliberate. |
|
Found it. The That PR was quite deliberate — it introduced the Task list (3/3 completed)
|
|
@pullfrog in that case a cleaner fix is simply removing that line, no? We throw after anyway |
|
Removed the redundant Task list (5/5 completed)
|

Fixes #3994
When the CLI encounters a missing input file,
createClientcatches theInputError, prints the error message viaprintCrashReport, and then returns[]instead of re-throwing. The CLI.action()handler sees an empty context, determines no watch mode is active, and callsprocess.exit(0), silently succeeding from CI's perspective.This changes the catch block in both
openapi-ts/src/generate.tsandopenapi-python/src/generate.tsto re-throwInputErrorinstead of returning an empty array. The error propagates up to the CLI's.action()handler, which rejects the promise, andrunCli()catches it and callsprocess.exit(1).DeepSeek Pro(free via Pullfrog for OSS) | 𝕏