DisTubeError
Extends
Section titled “Extends”Error
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Code extends ErrorCode |
ErrorCode |
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DisTubeError<
Code>(code,message,options?):DisTubeError<Code>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
code |
Code |
message |
string |
options? |
DisTubeErrorOptions |
Returns
Section titled “Returns”DisTubeError<Code>
Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause?:unknown
Inherited from
Section titled “Inherited from”Error.cause
readonlycode:Code
media?
Section titled “media?”
readonlyoptionalmedia?:ErrorMedia
Set by a plugin when the failure came from looking up one Song or one Playlist.
message
Section titled “message”message:
string
Inherited from
Section titled “Inherited from”Error.message
name:
string
Inherited from
Section titled “Inherited from”Error.name
query?
Section titled “query?”
readonlyoptionalquery?:string
Set when every plugin was exhausted; see DisTubeErrorOptions.query.
source?
Section titled “source?”
readonlyoptionalsource?:string
stack?
Section titled “stack?”
optionalstack?:string
Inherited from
Section titled “Inherited from”Error.stack
Methods
Section titled “Methods”
staticis<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 Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Code extends ErrorCode |
ErrorCode |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
error |
unknown |
code? |
Code |
Returns
Section titled “Returns”error is DisTubeError<Code>