This commit is contained in:
Rizky 2024-04-20 23:27:08 +07:00
parent 814c709814
commit 70766c4ea1
3 changed files with 25 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@ -167,7 +167,7 @@ export const viEvalScript = (
try { try {
${src} ${src}
} catch(e) { } catch(e) {
console.warn("Error at item ${meta.item.name}:", ${meta.item.adv?.js}); console.warn("Error at item ${meta.item.name}:", \`${meta.item.adv?.js}\`);
} }
` `
); );

View File

@ -13,6 +13,16 @@ type PRELOAD = Exclude<VG["on_preload"], undefined>;
type PRELOAD_ARGS = Parameters<PRELOAD>[0]; type PRELOAD_ARGS = Parameters<PRELOAD>[0];
const w = window as any; const w = window as any;
if (!w.prasi_error_handler) {
w.prasi_error_handler = true;
window.addEventListener("error", (errorEvent) => {
const { lineno, colno } = errorEvent;
console.log(`Error thrown at: ${lineno}:${colno}`);
errorEvent.preventDefault();
});
}
export const Vi: FC<{ export const Vi: FC<{
meta: Record<string, IMeta>; meta: Record<string, IMeta>;
mode: "mobile" | "desktop"; mode: "mobile" | "desktop";