catch global error and display on top of page
This commit is contained in:
@@ -45,7 +45,7 @@ const init = async () => {
|
|||||||
await init();
|
await init();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const $err = document.createElement("div");
|
const $err = document.createElement("div");
|
||||||
$err.innerText = `KISS-Translator Error: ${err.message}`;
|
$err.innerText = `KISS-Translator: ${err.message}`;
|
||||||
$err.style.cssText = "background:red; color:#fff; z-index:10000;";
|
$err.style.cssText = "background:red; color:#fff; z-index:10000;";
|
||||||
document.body.prepend($err);
|
document.body.prepend($err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ const init = async () => {
|
|||||||
await init();
|
await init();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const $err = document.createElement("div");
|
const $err = document.createElement("div");
|
||||||
$err.innerText = `KISS-Translator Error: ${err.message}`;
|
$err.innerText = `KISS-Translator: ${err.message}`;
|
||||||
$err.style.cssText = "background:red; color:#fff; z-index:10000;";
|
$err.style.cssText = "background:red; color:#fff; z-index:10000;";
|
||||||
document.body.prepend($err);
|
document.body.prepend($err);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user