Skip to content
Client
Server

Reference / @open-music-sdk/core / isAppleMusicError

Function: isAppleMusicError() ​

ts
function isAppleMusicError<Tag>(e, tag?): e is AppleMusicError<Tag>;

Defined in: packages/core/src/errors.ts:101

Whether e is an AppleMusicError, and of one kind when tag names it: the guard to narrow a caught error with.

Type Parameters ​

Tag ​

Tag extends tErrorTag = tErrorTag

Parameters ​

e ​

unknown

What was caught.

tag? ​

Tag

The one kind to ask for, such as "RateLimited"; left out, any kind will do.

Returns ​

e is AppleMusicError<Tag>

Whether e is an AppleMusicError by shape, from any copy of this package, and its _tag is tag where one was given.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.