Skip to content

Failures are logged and swallowed, and the entry point has no error handler #654

Description

@Jamie-BitFlight

What is wrong

Two failure paths catch, log and continue, so a run can partially fail and still exit 0. Separately, the entry point has no handler, so an error that does propagate reaches the user as a raw Node stack trace rather than a message.

Where it was observed

Catch-and-continue:

  • src/prettier.ts:99-101 — wrapDescription catches, calls log.error, continues. The description is then empty for that input.
  • src/save.ts:22-24 — catches, calls log.error, continues.

No top-level handler — src/index.ts is 16 lines and ends with a bare top-level await:

export async function generateReadme(): Promise<void> {
  const log = new LogTask('Generate Documentation');
  const inputs = new Inputs();
  const generator = new ReadmeGenerator(inputs, log);
  await generator.generate();
  return save(inputs, log);
}

await generateReadme();

Evidence

The second half is observable. Running the built binary in a directory where repository detection fails produces:

file:///…/dist/bin/index.js:42734
	throw new Error("No owner or repo found");
	      ^

Error: No owner or repo found
    at repositoryFinder (…)
    at loadDefaultConfig (…)
    at new Inputs (…)

Node.js v22.22.2

A user gets an internal stack trace with bundled line numbers.

Impact

Two distinct problems. A partially failed run — a description that failed to format, or a .ghadocs.json that failed to save — exits 0, so a CI pipeline gated on exit code treats it as success and the user has to read the log to notice. And a genuine failure is presented as a crash rather than as an error the user can act on, which is the same surface as #642.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions