@@ -11,7 +11,13 @@ import con_modal from './components/con-modal'
1111import { to_markdown , clean , auto_url_root } from './utils'
1212
1313let dsn = process . env . NODE_ENV === 'production' && 'https://[email protected] /128441' 14- Raven . config ( dsn , { release : process . env . RELEASE } ) . addPlugin ( RavenVue , Vue ) . install ( )
14+ let raven_config = {
15+ release : process . env . RELEASE ,
16+ tags : {
17+ host : window . location . host ,
18+ }
19+ }
20+ Raven . config ( dsn , raven_config ) . addPlugin ( RavenVue , Vue ) . install ( )
1521
1622Vue . use ( VueRouter )
1723
@@ -126,6 +132,7 @@ module.exports = function (public_key, config) {
126132 config [ k ] = STRINGS [ k ]
127133 }
128134 }
135+ Raven . setUserContext ( config )
129136
130137 return new Vue ( {
131138 el : config . element ,
@@ -199,7 +206,7 @@ response text: "${xhr.responseText}"`)
199206 xhr . open ( 'GET' , url )
200207 xhr . onload = ( ) => {
201208 if ( xhr . status !== 200 ) {
202- throw new Error ( `bad response ${ xhr . status } at "${ url } "` )
209+ this . handle_error ( `bad response ${ xhr . status } at "${ url } "` )
203210 } else {
204211 let con = JSON . parse ( xhr . responseText )
205212 Vue . set ( this . contractors_extra , link , con )
@@ -217,7 +224,11 @@ response text: "${xhr.responseText}"`)
217224 xhr . open ( 'GET' , url )
218225 xhr . onload = ( ) => {
219226 if ( xhr . status !== 200 ) {
220- throw new Error ( `bad response ${ xhr . status } at "${ url } "` )
227+ this . handle_error ( `\
228+ Connection error
229+ requested url: "${ url } "
230+ response status: ${ xhr . status }
231+ response text: "${ xhr . responseText } "` )
221232 } else {
222233 this . enquiry_form_info = Object . assign ( { } , this . enquiry_form_info , JSON . parse ( xhr . responseText ) )
223234 }
0 commit comments