mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove unnecessary duplicate error logging
This commit is contained in:
parent
a7fb8ebdd6
commit
224f3ab8cd
1 changed files with 3 additions and 9 deletions
|
@ -77,16 +77,12 @@ import { playbackManager } from './playback/playbackmanager';
|
||||||
|
|
||||||
const pluginDefinition = await window[pluginSpec];
|
const pluginDefinition = await window[pluginSpec];
|
||||||
if (typeof pluginDefinition !== 'function') {
|
if (typeof pluginDefinition !== 'function') {
|
||||||
const err = new TypeError('Plugin definitions in window have to be an (async) function returning the plugin class');
|
throw new TypeError('Plugin definitions in window have to be an (async) function returning the plugin class');
|
||||||
console.error(err);
|
|
||||||
throw err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const pluginClass = await pluginDefinition();
|
const pluginClass = await pluginDefinition();
|
||||||
if (typeof pluginClass !== 'function') {
|
if (typeof pluginClass !== 'function') {
|
||||||
const err = new TypeError(`Plugin definition doesn't return a class for '${pluginSpec}'`);
|
throw new TypeError(`Plugin definition doesn't return a class for '${pluginSpec}'`);
|
||||||
console.error(err);
|
|
||||||
throw err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// init plugin and pass basic dependencies
|
// init plugin and pass basic dependencies
|
||||||
|
@ -107,9 +103,7 @@ import { playbackManager } from './playback/playbackmanager';
|
||||||
const pluginResult = await pluginSpec;
|
const pluginResult = await pluginSpec;
|
||||||
plugin = new pluginResult.default;
|
plugin = new pluginResult.default;
|
||||||
} else {
|
} else {
|
||||||
const err = new TypeError('Plugins have to be a Promise that resolves to a plugin builder function');
|
throw new TypeError('Plugins have to be a Promise that resolves to a plugin builder function');
|
||||||
console.error(err);
|
|
||||||
throw err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.#preparePlugin(pluginSpec, plugin);
|
return this.#preparePlugin(pluginSpec, plugin);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue