Musickit error handling
This commit is contained in:
parent
71496052df
commit
dcc82aa72e
2 changed files with 15 additions and 0 deletions
|
@ -229,6 +229,7 @@
|
|||
"home.followedArtists": "Followed Artists",
|
||||
"error.appleMusicSubRequired": "Apple Music requires a subscription.",
|
||||
"error.connectionError": "There was a problem connecting to Apple Music.",
|
||||
"error.musickitError": "MusicKit Encountered an Error: ",
|
||||
"error.noResults": "No Results.",
|
||||
"error.noResults.description": "Try a new search.",
|
||||
"podcast.followOnCider": "Follow On Cider",
|
||||
|
|
|
@ -305,6 +305,20 @@ const app = new Vue({
|
|||
app.cfg.musickit["stored-attributes"][attr] = val;
|
||||
});
|
||||
}
|
||||
const ERROR_CODES = ["drmUnsupported", "mediaPlaybackError"];
|
||||
/* MusicKit.Events */
|
||||
ERROR_CODES.forEach((code) => {
|
||||
MusicKit.getInstance().addEventListener(MusicKit.Events[code], (e) => {
|
||||
console.error(`[MusicKit] MusicKit Error ${code}`);
|
||||
console.error({ e: e });
|
||||
app.notyf.open({
|
||||
duration: 20000,
|
||||
type: "error",
|
||||
className: "notyf-info",
|
||||
message: `<small>${app.getLz("error.musickitError")} \n</small><code>${code.toUpperCase()}</code>`,
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
async oobeInit() {
|
||||
this.appMode = "oobe";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue