consider background scripts when throwing errors or warnings
This commit is contained in:
parent
6332d17ca6
commit
4fe0abc374
1 changed files with 6 additions and 14 deletions
|
@ -53,13 +53,9 @@ export default class logging {
|
|||
*/
|
||||
static warn(message, critical = false) {
|
||||
console.warn(message);
|
||||
if (critical) {
|
||||
alert(message);
|
||||
} else {
|
||||
try {
|
||||
M.toast({ text: message });
|
||||
} catch (err) {}
|
||||
}
|
||||
(critical) ? alert(message) : M.toast({ text: message });
|
||||
} catch(err) {};
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -72,13 +68,9 @@ export default class logging {
|
|||
static async error(ERROR_CODE, ERROR_MESSAGE, ERROR_STACK, critical = true) {
|
||||
// Display the error message.
|
||||
console.error(texts.localized(`error_msg`, false, [ERROR_CODE, ERROR_MESSAGE, ERROR_STACK]));
|
||||
if (critical) {
|
||||
alert(texts.localized(`error_msg_GUI`, false, [String(ERROR_CODE), ERROR_MESSAGE]));
|
||||
} else {
|
||||
try {
|
||||
M.toast({ text: ERROR_MESSAGE });
|
||||
(critical) ? alert(texts.localized(`error_msg_GUI`, false, [String(ERROR_CODE), ERROR_MESSAGE])) : M.toast({ text: ERROR_MESSAGE });
|
||||
} catch(err) {};
|
||||
};
|
||||
}
|
||||
|
||||
/* Clear the current message. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue