mirror of
https://github.com/Lissy93/dashy.git
synced 2024-11-28 13:43:05 +03:00
⚡ Adds second param to ErrorHandler for printing stack trace
This commit is contained in:
parent
9915100c13
commit
e8fa255e2e
@ -22,10 +22,15 @@ const appendToErrorLog = (msg) => {
|
||||
* If error reporting is enabled, will also log the message to Sentry
|
||||
* If you wish to use your own error logging service, put code for it here
|
||||
*/
|
||||
const ErrorHandler = function handler(msg) {
|
||||
warningMsg(msg); // Print to console
|
||||
appendToErrorLog(msg); // Save to local storage
|
||||
Sentry.captureMessage(`[USER-WARN] ${msg}`); // Report to bug tracker (if enabled)
|
||||
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
|
||||
// Save to local storage
|
||||
appendToErrorLog(msg);
|
||||
// Report to bug tracker (if enabled)
|
||||
Sentry.captureMessage(`[USER-WARN] ${msg}`);
|
||||
};
|
||||
|
||||
/* Similar to error handler, but for recording general info */
|
||||
|
Loading…
Reference in New Issue
Block a user