Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41242,7 +41242,8 @@ function normalizeSweep(source, raw) {
ms = parseDuration(raw.lookback, 'sweep.lookback');
}
catch (e) {
throw new Error(`${source}: ${e instanceof Error ? e.message : e}`);
// parseDuration throws only Error
throw new Error(`${source}: ${e instanceof Error ? e.message : /* v8 ignore next -- non-Error arm unreachable from dist/index.js; configSweep.test.ts drives it */ e}`);
}
if (ms <= 0) {
throw new Error(`${source}: sweep.lookback must be longer than 0`);
Expand Down Expand Up @@ -42622,6 +42623,9 @@ function hasCommand(command, body) {
* @param body - the full body of the comment
*/
function getLineArgs(command, body) {
// both callers (/milestone, /retitle) run only after hasCommand matched the same pattern, so at(-1) is a string from the bundle;
// the hint sits on the statement because a hint on one operand of a ?? expression is not honoured
/* v8 ignore next -- absent-command fallback unreachable from dist/index.js; command.test.ts drives it */
return findCommandArgs(command, body).at(-1) ?? '';
}
/**
Expand Down Expand Up @@ -46905,7 +46909,9 @@ async function run() {
await handler(context);
}
catch (error) {
setFailed(error instanceof Error ? error.message : String(error));
// every handler folds its rejections into an Error (runEventHandlers, normalizeError, the jobs .catch),
// and the only throw that reaches this catch from the bundle is a built-in TypeError
setFailed(error instanceof Error ? error.message : /* v8 ignore next -- non-Error arm unreachable from dist/index.js; run.test.ts drives it */ String(error));
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export async function run(): Promise<void> {
await handler(context)
}
catch (error) {
core.setFailed(error instanceof Error ? error.message : String(error))
// every handler folds its rejections into an Error (runEventHandlers, normalizeError, the jobs .catch),
// and the only throw that reaches this catch from the bundle is a built-in TypeError
core.setFailed(error instanceof Error ? error.message : /* v8 ignore next -- non-Error arm unreachable from dist/index.js; run.test.ts drives it */ String(error))
}
}
3 changes: 3 additions & 0 deletions src/utils/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export function hasCommand(command: string, body: string): boolean {
* @param body - the full body of the comment
*/
export function getLineArgs(command: string, body: string): string {
// both callers (/milestone, /retitle) run only after hasCommand matched the same pattern, so at(-1) is a string from the bundle;
// the hint sits on the statement because a hint on one operand of a ?? expression is not honoured
/* v8 ignore next -- absent-command fallback unreachable from dist/index.js; command.test.ts drives it */
return findCommandArgs(command, body).at(-1) ?? ''
}

Expand Down
3 changes: 2 additions & 1 deletion src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,8 @@ function normalizeSweep(source: string, raw: unknown): SweepConfig {
ms = parseDuration(raw.lookback, 'sweep.lookback')
}
catch (e) {
throw new Error(`${source}: ${e instanceof Error ? e.message : e}`)
// parseDuration throws only Error
throw new Error(`${source}: ${e instanceof Error ? e.message : /* v8 ignore next -- non-Error arm unreachable from dist/index.js; configSweep.test.ts drives it */ e}`)
}
if (ms <= 0) {
throw new Error(`${source}: sweep.lookback must be longer than 0`)
Expand Down
Loading