diff --git a/src/config/config.ts b/src/config/config.ts index e973ec7cf..3adb495dc 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -230,7 +230,12 @@ export class Config implements IConfig { } } - public async runHook(event: T, opts: Hooks[T]['options'], timeout?: number): Promise> { + public async runHook( + event: T, + opts: Hooks[T]['options'], + timeout?: number, + captureErrors?: boolean, + ): Promise> { debug('start %s hook', event) const search = (m: any): Hook => { if (typeof m === 'function') return m @@ -293,6 +298,7 @@ export class Config implements IConfig { } catch (error: any) { final.failures.push({plugin: p, error: error as Error}) debug(error) + if (!captureErrors && error.oclif?.exit !== undefined) throw error } } })