File tree Expand file tree Collapse file tree
contentcuration/contentcuration/frontend/shared Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,10 +54,23 @@ client.interceptors.response.use(
5454 if ( process . env . NODE_ENV !== 'production' ) {
5555 // In dev build log warnings to console for developer use
5656 console . warn ( 'AJAX Request Error: ' + message ) ; // eslint-disable-line no-console
57- console . warn ( 'Error data: ' + JSON . stringify ( error ) ) ; // eslint-disable-line no-console
57+ console . warn ( 'Error data: ' , error ) ; // eslint-disable-line no-console
5858 } else {
59- Sentry . captureException ( new Error ( message ) , {
60- contexts : { error } ,
59+ Sentry . withScope ( function ( scope ) {
60+ scope . addAttachment ( {
61+ filename : 'error.json' ,
62+ data : JSON . stringify ( error ) ,
63+ contentType : 'application/json' ,
64+ } ) ;
65+ Sentry . captureException ( new Error ( message ) , {
66+ extra : {
67+ Request : {
68+ headers : error . config . headers ,
69+ method : error . config . method ,
70+ url,
71+ } ,
72+ } ,
73+ } ) ;
6174 } ) ;
6275 }
6376 return Promise . reject ( error ) ;
You can’t perform that action at this time.
0 commit comments