mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 17:37:51 +01:00
use the initerr function owo
This commit is contained in:
parent
4ced593d75
commit
0668ca9ab7
1 changed files with 9 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue