Skip to content

writeReviewFailureReport

writeReviewFailureReport(config, source, command, error): string | null

Defined in: packages/review/src/modules/reviewFailureReport.ts:73

Write the promised report for a run that ended before the agent was reached.

Call it from every exit that fails a review/pr run before review() is invoked, passing the SAME source label that call would have used (PR-42, PR-discovery, REVIEW, pr-review) so the file lands where the successful run would have put it — the label picks the generated file name when writeOutputToFile is true.

A no-op when the config asks for no file, so the default stdout-only run is untouched. It never throws: it runs inside a catch, and a report that cannot be written must not replace the error the caller is already reporting.

GthConfig | undefined

The resolved config, or undefined when the run failed before config loaded (nothing can be written then — the path is a config field).

string

The source label the successful run would have passed to review().

"pr" | "review"

review or pr; names the command in the heading.

unknown

The failure, as an Error or as text already rendered for the terminal.

string | null

The path written, or null when no report was asked for or the write failed.