Skip to content

Commit

Permalink
Chore: Add more detail to shaka error logging (#435)
Browse files Browse the repository at this point in the history
There is a "data" property to the shaka error object, which gives more
useful detail on the error, especially for media-element errors. See
https://shaka-player-demo.appspot.com/docs/api/shaka.util.Error.html for
the various errors.
  • Loading branch information
bhh1988 committed Oct 16, 2017
1 parent e26e323 commit aa14549
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/viewers/media/DashViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class DashViewer extends VideoBaseViewer {
shakaErrorHandler(shakaError) {
const error = new Error(
`Shaka error. Code = ${shakaError.detail.code}, Category = ${shakaError.detail
.category}, Severity = ${shakaError.detail.severity}`
.category}, Severity = ${shakaError.detail.severity}, Data = ${shakaError.detail.data.toString()}`
);
error.displayMessage = __('error_refresh');

Expand Down
6 changes: 4 additions & 2 deletions src/lib/viewers/media/__tests__/DashViewer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ describe('lib/viewers/media/DashViewer', () => {
detail: {
severity: 2, // critical severity
category: 1,
code: 1100
code: 1100,
data: ['foobar']
}
};

Expand All @@ -448,7 +449,8 @@ describe('lib/viewers/media/DashViewer', () => {
detail: {
severity: 1, // recoverable severity
category: 1,
code: 1100
code: 1100,
data: ['foobar']
}
};

Expand Down

0 comments on commit aa14549

Please sign in to comment.