Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:zap: Adds second param to ErrorHandler for printing stack trace

Alicia Sykese8fa255e2ecc
diff --git a/src/utils/ErrorHandler.js b/src/utils/ErrorHandler.js
index 280c4a0a..4c56e900 100644
--- a/src/utils/ErrorHandler.js
+++ b/src/utils/ErrorHandler.js
@@ -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 */