File tree 1 file changed +17
-5
lines changed
1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,23 @@ const rollbar = new Rollbar(config);
7
7
export default {
8
8
install ( app ) {
9
9
app . config . errorHandler = ( error , vm , info ) => {
10
- rollbar . error ( error , { vueComponent : vm , info } ) ;
11
- if ( app . config . devtools ) {
12
- console . error ( error ) ;
13
- }
14
- } ;
10
+
11
+ // In case the error is from the router or am helper
12
+ // calling vm could generate a loop and freeze the browser
13
+ // rollbar.error(error, { vueComponent: vm, info });
14
+
15
+ rollbar . error ( error , { info } ) ;
16
+
17
+ if ( app . config . devtools ) console . error ( error ) ;
18
+ }
19
+
20
+
21
+ app . config . warningHandler = ( error , vm , info ) => {
22
+ rollbar . warning ( error , { info } ) ;
23
+
24
+ if ( app . config . devtools ) console . log ( 'just a warning, but!,error)
25
+ }
26
+
15
27
app . provide ( 'rollbar' , rollbar ) ;
16
28
} ,
17
29
} ;
You can’t perform that action at this time.
0 commit comments