mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 10:42:12 +00:00
throw more accurate errors when fetch/parse subtitles
This commit is contained in:
parent
2dc9e84804
commit
1c062dac7f
1 changed files with 9 additions and 2 deletions
|
|
@ -254,6 +254,13 @@ var HTMLVideo = function(container) {
|
|||
.then(function(resp) {
|
||||
return resp.text();
|
||||
})
|
||||
.catch(function() {
|
||||
events.emit('error', {
|
||||
code: 70,
|
||||
message: 'Failed to fetch subtitles from ' + subtitleTrack.origin,
|
||||
critical: false
|
||||
});
|
||||
})
|
||||
.then(function(text) {
|
||||
if (selectedSubtitleTrackId === subtitleTrack.id) {
|
||||
subtitleCues = subtitleUtils.parse(text);
|
||||
|
|
@ -262,8 +269,8 @@ var HTMLVideo = function(container) {
|
|||
})
|
||||
.catch(function() {
|
||||
events.emit('error', {
|
||||
code: 68,
|
||||
message: 'Failed to fetch subtitles from ' + subtitleTrack.origin,
|
||||
code: 71,
|
||||
message: 'Failed to parse subtitles from ' + subtitleTrack.origin,
|
||||
critical: false
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue