Skip to content
This repository was archived by the owner on Nov 5, 2020. It is now read-only.

Commit 995327a

Browse files
committed
fix: err.code changed to err.name for handling json error
1 parent 34b935f commit 995327a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/videoData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default class VideoData {
129129
try {
130130
config = JSON.parse(jsonStr.slice(0, jsonStr.lastIndexOf(';ytplayer.load')));
131131
} catch (err) {
132-
if (err.code === 'SyntaxError') {
132+
if (err.name === 'SyntaxError') {
133133
return this.getVideoInfo(videoId);
134134
}
135135
throw err;

0 commit comments

Comments
 (0)