Skip to content

Commit 69a5e5b

Browse files
committed
add global never throw override
1 parent 3f6c52f commit 69a5e5b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/coordinator/src/exec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ interface ExecOptions {
2222
abortSignal?: AbortSignal;
2323
logOutput?: boolean;
2424
trimArgs?: boolean;
25+
neverThrow?: boolean;
2526
}
2627

2728
export class Exec {
@@ -30,13 +31,15 @@ export class Exec {
3031

3132
private logOutput: boolean;
3233
private trimArgs: boolean;
34+
private neverThrow: boolean;
3335

3436
constructor(opts: ExecOptions) {
3537
this.logger = opts.logger ?? new SimpleLogger();
3638
this.abortSignal = opts.abortSignal;
3739

3840
this.logOutput = opts.logOutput ?? true;
3941
this.trimArgs = opts.trimArgs ?? true;
42+
this.neverThrow = opts.neverThrow ?? false;
4043
}
4144

4245
async x(
@@ -68,7 +71,7 @@ export class Exec {
6871
this.logger.debug(`output: ${commandWithFirstArg}`, metadata);
6972
}
7073

71-
if (opts?.neverThrow) {
74+
if (this.neverThrow || opts?.neverThrow) {
7275
return output;
7376
}
7477

0 commit comments

Comments
 (0)