🥅 Updates error catching functionality, to handle stack traces

This commit is contained in:
Alicia Sykes
2021-12-13 21:37:43 +00:00
parent aa770d6629
commit f9a0005740
2 changed files with 6 additions and 5 deletions

View File

@@ -24,9 +24,7 @@ const appendToErrorLog = (msg) => {
*/
const ErrorHandler = function handler(msg, errorStack) {
// Print to console
warningMsg(msg);
// If stack trace included, then print that too
if (errorStack) console.warn(errorStack); // eslint-disable-line no-console
warningMsg(msg, errorStack);
// Save to local storage
appendToErrorLog(msg);
// Report to bug tracker (if enabled)