All custom errors thrown from inquirer now includes a name
attribute reflecting the error class. When checking if an error comes from inquirer AND using a bundler (like tsup, rollup, etc), instanceof
might not work as you expect it to. So instead, it is recommend to follow this example:
- if (error instanceof ExitPromptError) {
+ if (error.name === 'ExitPromptError') {