diff --git a/src/octoprint/server/util/webassets.py b/src/octoprint/server/util/webassets.py index 5fb9d0c80..5d93c2b32 100644 --- a/src/octoprint/server/util/webassets.py +++ b/src/octoprint/server/util/webassets.py @@ -172,7 +172,7 @@ _PLUGIN_BUNDLE_WRAPPER_PREFIX = """// JS assets for plugin {plugin} """ _PLUGIN_BUNDLE_WRAPPER_SUFFIX = """ }} catch (error) {{ - log.error("Error in JS assets for plugin {plugin}:", (error.stack || error)); + log.error("Error in JS assets for plugin {plugin}:", `${{exc.message}}\n${{exc.stack || exc}}`); }} }})(); """ diff --git a/src/octoprint/static/js/app/helpers.js b/src/octoprint/static/js/app/helpers.js index b9fff229a..c2634fd99 100644 --- a/src/octoprint/static/js/app/helpers.js +++ b/src/octoprint/static/js/app/helpers.js @@ -1367,7 +1367,7 @@ function setOnViewModelIf(viewModel, key, value, condition) { "on view model", viewModel.constructor.name, ":", - exc.stack || exc + `${exc.message}\n${exc.stack || exc}` ); } } @@ -1392,7 +1392,7 @@ function callViewModelsIf(allViewModels, method, condition, callback) { "on view model", viewModel.constructor.name, ":", - exc.stack || exc + `${exc.message}\n${exc.stack || exc}` ); } }); @@ -1476,7 +1476,7 @@ function callViewModelIf(viewModel, method, condition, callback, raiseErrors) { "on view model", viewModel.constructor.name, ":", - exc.stack || exc + `${exc.message}\n${exc.stack || exc}` ); } } diff --git a/src/octoprint/static/js/app/main.js b/src/octoprint/static/js/app/main.js index bb5f3ff29..3fae4206a 100644 --- a/src/octoprint/static/js/app/main.js +++ b/src/octoprint/static/js/app/main.js @@ -506,7 +506,12 @@ $(function () { if (typeof Sentry !== "undefined") { Sentry.captureException(exc); } - log.error("Error instantiating", viewModel.name, ":", exc.stack || exc); + log.error( + "Error instantiating", + viewModel.name, + ":", + `${exc.message}\n${exc.stack || exc}` + ); continue; } @@ -794,7 +799,7 @@ $(function () { "Error calling onBeforeBinding on view model", viewModel.constructor.name, ":", - exc.stack || exc + `${exc.message}\n${exc.stack || exc}` ); return; } @@ -829,7 +834,7 @@ $(function () { "of view model", viewModel.constructor.name, ":", - exc.stack || exc + `${exc.message}\n${exc.stack || exc}` ); return; } @@ -887,7 +892,7 @@ $(function () { "to target", target, ":", - exc.stack || exc + `${exc.message}\n${exc.stack || exc}` ); } }); @@ -911,7 +916,7 @@ $(function () { "Error while processing view model", name, "for binding:", - exc.stack || exc + `${exc.message}\n${exc.stack || exc}` ); } }); diff --git a/src/octoprint/static/js/app/viewmodels/settings.js b/src/octoprint/static/js/app/viewmodels/settings.js index 0f97b1da2..085cf1994 100644 --- a/src/octoprint/static/js/app/viewmodels/settings.js +++ b/src/octoprint/static/js/app/viewmodels/settings.js @@ -719,7 +719,7 @@ $(function () { "Error calling settings callback", callback, ":", - exc.stack || exc.stacktrace || exc + `${exc.message}\n${exc.stack || exc}` ); } };