Skip to content

Commit

Permalink
fix: Silence uncaught rejection errors when closing EME sessions (#7881)
Browse files Browse the repository at this point in the history
Fixes #4199
  • Loading branch information
avelad authored Jan 13, 2025
1 parent 57992b2 commit bc6a79f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/drm/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,7 @@ shaka.drm.DrmEngine = class {
if (found && !found.updatePromise) {
shaka.log.debug('Session has expired', session.sessionId);
this.activeSessions_.delete(session);
session.close().catch(() => {}); // Silence uncaught rejection errors
this.closeSession_(session);
}
}

Expand Down Expand Up @@ -2116,7 +2116,7 @@ shaka.drm.DrmEngine = class {
try {
await shaka.util.Functional.promiseWithTimeout(
shaka.drm.DrmEngine.CLOSE_TIMEOUT_,
Promise.all([session.close(), session.closed]));
Promise.all([session.close().catch(() => {}), session.closed]));
} catch (e) {
shaka.log.warning('Timeout waiting for session close');
}
Expand Down

0 comments on commit bc6a79f

Please sign in to comment.