You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error thrown from a transformer (after a default value is applied) gets swallowed and the CLI app quits, which makes debugging difficult.
Some sample code:
constInquirer=require("inquirer");(async()=>{try{awaitInquirer.prompt([{type: "input",message: "Foo quotient",name: "foo",transformer: (x)=>{if(x===1){thrownewError("failing because of the reason");}returnx;},default: 1,},]);console.log("Done");}catch(e){console.error("An _expected_ error",e);}})();
In this example, when no input is offered by the user, I would expect:
the default is applied (1)
error is thrown
catch block outputs error
But instead the program silently quits (no error, no "Done" logged).
(I'm not sure if version 8 is actively maintained but unable to switch to ES modules at present.)
The text was updated successfully, but these errors were encountered:
An error thrown from a transformer (after a default value is applied) gets swallowed and the CLI app quits, which makes debugging difficult.
Some sample code:
In this example, when no input is offered by the user, I would expect:
But instead the program silently quits (no error, no "Done" logged).
(I'm not sure if version 8 is actively maintained but unable to switch to ES modules at present.)
The text was updated successfully, but these errors were encountered: