mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #5734 from prsantos-com/sonarcloud-promise-rejection
Use Error instead of literal for promise rejection
This commit is contained in:
commit
b9dea3a788
7 changed files with 8 additions and 7 deletions
|
@ -26,7 +26,7 @@ export function waitForEventOnce(emitter, eventType, timeout, rejectEventTypes)
|
|||
let rejectTimeout;
|
||||
if (timeout) {
|
||||
rejectTimeout = setTimeout(() => {
|
||||
reject('Timed out.');
|
||||
reject(new Error('Timed out.'));
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ class QueueCore {
|
|||
|
||||
if (!itemIds.length) {
|
||||
if (this.lastPlayQueueUpdate && playQueueUpdate.LastUpdate.getTime() <= this.getLastUpdateTime()) {
|
||||
return Promise.reject('Trying to apply old update');
|
||||
return Promise.reject(new Error('Trying to apply old update'));
|
||||
}
|
||||
|
||||
this.lastPlayQueueUpdate = playQueueUpdate;
|
||||
|
|
|
@ -113,7 +113,7 @@ class TimeSync {
|
|||
*/
|
||||
requestPing() {
|
||||
console.warn('SyncPlay TimeSync requestPing: override this method!');
|
||||
return Promise.reject('Not implemented.');
|
||||
return Promise.reject(new Error('Not implemented.'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue