From 0668ca9ab7d51553ccbfe98ae8d894ed1cafd3a8 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 19 Apr 2023 22:10:18 +0000 Subject: [PATCH] use the initerr function owo --- src/libpoketube/libpoketube-core.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index 937dc6be..7004e631 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -29,6 +29,11 @@ const config = { t_url: "https://t.poketube.fun/", // def matomo url }; +function initerr(args){ + console.error("[LIBPT CORE ERROR]" + args) +} + + // Util functions function getJson(str) { try { @@ -87,7 +92,7 @@ async function video(v) { var comments = await getJson(inv_comments); } catch (error) { - console.error("Error getting comments", error); + initerr("Error getting comments", error); var comments = ""; } @@ -99,7 +104,7 @@ async function video(v) { ); vid = await getJson(videoInfo); } catch (error) { - console.error("Error getting video info", error); + initerr("Error getting video info", error); } if (!vid) { @@ -118,7 +123,7 @@ async function video(v) { .then((res) => res.text()) .then((xml) => getJson(toJson(xml))); } catch (error) { - console.error("Error getting channel info", error); + initerr("Error getting channel info", error); var a = ""; } @@ -167,7 +172,7 @@ async function video(v) { return cache[v].result; } catch (error) { - console.error("Error getting video", error); + initerr("Error getting video", error); } } }