Skip to content

DisTubeError

  • Error
Type Parameter Default type
Code extends ErrorCode ErrorCode

new DisTubeError<Code>(code, message, options?): DisTubeError<Code>

Parameter Type
code Code
message string
options? DisTubeErrorOptions

DisTubeError<Code>

Error.constructor

optional cause?: unknown

Error.cause


readonly code: Code


readonly optional media?: ErrorMedia

Set by a plugin when the failure came from looking up one Song or one Playlist.


message: string

Error.message


name: string

Error.name


readonly optional query?: string

Set when every plugin was exhausted; see DisTubeErrorOptions.query.


readonly optional source?: string


optional stack?: string

Error.stack

static is<Code>(error, code?): error is DisTubeError<Code>

Narrows error to a DisTubeError, carrying exactly code when given. Matches by name and code rather than class identity, so an error from another installed copy of the package narrows too.

Type Parameter Default type
Code extends ErrorCode ErrorCode
Parameter Type
error unknown
code? Code

error is DisTubeError<Code>