Skip to content

Commit

Permalink
Warn on promise chain loading issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjamie committed Jun 22, 2020
1 parent 768fc0e commit c05f7ec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/controller/base-stream-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,12 @@ export default class BaseStreamController extends TaskLoop {
this._doFragLoad(frag)
.then((data: FragLoadSuccessResult) => {
if (!data || this._fragLoadAborted(frag) || !this.levels) {
return;
throw new Error('init load aborted');
}

return data;
}).then((data: FragLoadSuccessResult) => {
})
.then((data: FragLoadSuccessResult) => {
const { hls } = this;
const { payload } = data;
const decryptData = frag.decryptdata;
Expand Down Expand Up @@ -234,7 +235,7 @@ export default class BaseStreamController extends TaskLoop {
}).then((data: FragLoadSuccessResult) => {
const { fragCurrent, hls, levels } = this;
if (!levels) {
return;
throw new Error('init load aborted, missing levels');
}

const details = levels[frag.level].details as LevelDetails;
Expand All @@ -255,6 +256,8 @@ export default class BaseStreamController extends TaskLoop {
hls.trigger(Events.FRAG_BUFFERED, { stats, frag: fragCurrent, id: frag.type });
}
this.tick();
}).catch(reason => {
logger.warn(reason);
});
}

Expand Down

0 comments on commit c05f7ec

Please sign in to comment.