Add back youtube api error handling

This commit is contained in:
Ajay Ramachandran
2021-06-01 16:14:21 -04:00
parent ec51ff835a
commit f20506bf43

View File

@@ -27,6 +27,7 @@ export class YouTubeAPI {
}
}
try {
const { ytErr, data } = await new Promise((resolve) => _youTubeAPI.videos.list({
part,
id: videoID,
@@ -50,5 +51,8 @@ export class YouTubeAPI {
} else {
return { err: ytErr, data };
}
} catch (err) {
return {err, data: null}
}
}
}