Skip to content

Commit

Permalink
Chore(p-video): Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Vija02 committed Mar 2, 2025
1 parent 831af02 commit 0e27af1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugins/video-player/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@ const getAppRouter = (t: TRPCObject) => {
}
const res = await yt.getBasicInfo(youtubeId);

if (!res.basic_info.title) {
rawLogger.trace(
{ res, ytVideoUrl: opts.input.ytVideoUrl, youtubeId },
"Error: Title not available.",
);

throw new Error("Invalid data");
}

return {
title: res.basic_info.title,
duration: res.basic_info.duration,
Expand Down

0 comments on commit 0e27af1

Please sign in to comment.