Skip to content

Function: isCommandError() ​

Check whether an error is a CommandError.

An error from another copy of gunshi is recognized through the Symbol.for('gunshi.CommandError') brand. It is not recognized by error.name, so an error of the app that is also named CommandError is not taken for one.

Signature ​

ts
export function isCommandError(error: unknown): error is CommandError

Parameters ​

NameTypeDescription
errorunknownAn unknown error

Returns ​

error is CommandError — true if the error is a CommandError

Released under the MIT License.