@@ -10,14 +10,18 @@ import grid from './components/grid'
1010import con_modal from './components/con-modal'
1111import { to_markdown , clean , auto_url_root } from './utils'
1212
13- let dsn = process . env . NODE_ENV === 'production' && 'https://[email protected] /128441' 1413let raven_config = {
1514 release : process . env . RELEASE ,
1615 tags : {
1716 host : window . location . host ,
17+ } ,
18+ shouldSendCallback : ( data ) => {
19+ // if no culprit this a message and came from socket
20+ let culprit = data . culprit || '/socket.js'
21+ return culprit . indexOf ( '/socket.js' ) > 0
1822 }
1923}
20- Raven . config ( dsn , raven_config ) . addPlugin ( RavenVue , Vue ) . install ( )
24+ Raven . config ( process . env . RAVEN_DSN , raven_config ) . addPlugin ( RavenVue , Vue ) . install ( )
2125
2226Vue . use ( VueRouter )
2327
@@ -87,6 +91,11 @@ const ROUTER_MODES = ['hash', 'history']
8791
8892module . exports = function ( public_key , config ) {
8993 config = config || { }
94+ Raven . setExtraContext ( {
95+ public_key : public_key ,
96+ config : config ,
97+ } )
98+
9099 let error = null
91100 if ( config . mode === undefined ) {
92101 config . mode = 'grid'
@@ -135,14 +144,13 @@ module.exports = function (public_key, config) {
135144 config [ k ] = STRINGS [ k ]
136145 }
137146 }
138- Raven . setUserContext ( config )
139147
140148 return new Vue ( {
141149 el : config . element ,
142150 router : ConfiguredVueRouter ( config ) ,
143151 render : h => h ( app ) ,
144152 data : {
145- grecaptcha_key : process . env . NODE_ENV === 'testing' ? null : '6LdyXRgUAAAAADUNhMVKJDXiRr6DUN8TGOgllqbt' ,
153+ grecaptcha_key : process . env . GRECAPTCHA_KEY ,
146154 contractors : [ ] ,
147155 contractors_extra : { } ,
148156 config : config ,
@@ -164,7 +172,10 @@ module.exports = function (public_key, config) {
164172 handle_error : function ( error_message ) {
165173 this . error = error_message || 'unknown'
166174 config . console . error ( 'SOCKET: ' + this . error )
167- Raven . captureException ( new Error ( this . error ) )
175+ Raven . captureMessage ( this . error , {
176+ level : 'error' ,
177+ fingerprint : [ '{{ default }}' , public_key ] ,
178+ } )
168179 } ,
169180 get_list : function ( ) {
170181 // if an error already exists show that and return
0 commit comments