diff --git a/lib/prompts.js b/lib/prompts.js index 9f62556..e08923f 100644 --- a/lib/prompts.js +++ b/lib/prompts.js @@ -11,7 +11,7 @@ function toPrompt(type, args, opts={}) { const onExit = opts.onExit || noop; p.on('state', args.onState || noop); p.on('submit', x => res(onSubmit(x))); - p.on('exit', x => res(onExit(x))); + p.on('exit', x => rej(onExit(x))); p.on('abort', x => rej(onAbort(x))); }); }