Skip to content

Commit

Permalink
Fix: Pass shaka data to error detail so it can be logged (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Press authored Oct 10, 2018
1 parent f5367bf commit 8fdd344
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/viewers/media/DashViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,10 @@ class DashViewer extends VideoBaseViewer {
const error = new PreviewError(
ERROR_CODE.SHAKA,
__('error_refresh'),
{},
{
code: normalizedShakaError.code,
severity: normalizedShakaError.severity
},
`Shaka error. Code = ${normalizedShakaError.code}, Category = ${
normalizedShakaError.category
}, Severity = ${normalizedShakaError.severity}, Data = ${normalizedShakaError.data.toString()}`
Expand Down
2 changes: 2 additions & 0 deletions src/lib/viewers/media/__tests__/DashViewer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ describe('lib/viewers/media/DashViewer', () => {
const [event, error] = dash.emit.getCall(0).args;
expect(event).to.equal('error');
expect(error).to.be.instanceof(PreviewError);
expect(error.details.code).to.equal(shakaError.detail.code);
expect(error.details.severity).to.equal(shakaError.detail.severity);
expect(error.code).to.equal('error_shaka');
});

Expand Down

0 comments on commit 8fdd344

Please sign in to comment.