diff --git a/examples/vuejs3/src/rollbar.js b/examples/vuejs3/src/rollbar.js index 0887d9fd..08b25525 100644 --- a/examples/vuejs3/src/rollbar.js +++ b/examples/vuejs3/src/rollbar.js @@ -7,11 +7,23 @@ const rollbar = new Rollbar(config); export default { install(app) { app.config.errorHandler = (error, vm, info) => { - rollbar.error(error, { vueComponent: vm, info }); - if (app.config.devtools) { - console.error(error); - } - }; + + // In case the error is from the router or am helper + // calling vm could generate a loop and freeze the browser + // rollbar.error(error, { vueComponent: vm, info }); + + rollbar.error(error, { info }); + + if (app.config.devtools) console.error(error); + } + + + app.config.warningHandler = (error, vm, info) => { + rollbar.warning(error, { info }); + + if (app.config.devtools) console.log('just a warning, but!,error) + } + app.provide('rollbar', rollbar); }, };