Skip to content

Commit

Permalink
fix: handle prompt cancellation error gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Dec 19, 2023
1 parent a6c5095 commit b73a8ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/exception_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* file that was distributed with this source code.
*/

import { errors as promptsErrors } from '@poppinss/prompts'
import { errors, Kernel } from '../index.js'
import { renderErrorWithSuggestions } from './helpers.js'

Expand Down Expand Up @@ -75,6 +76,14 @@ export class ExceptionHandler {
return
}

/**
* Display prompt cancellation error
*/
if (error instanceof promptsErrors.E_PROMPT_CANCELLED) {
this.logError({ message: 'Process exited during prompt cancellation' }, kernel)
return
}

/**
* Known errors should always be reported with a message
*/
Expand Down

0 comments on commit b73a8ca

Please sign in to comment.