File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
datadog-instrumentations/src/http2 Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,11 @@ function createWrapRequest (authority, options) {
3333 const ctx = { headers, authority, options }
3434
3535 return startChannel . runStores ( ctx , ( ) => {
36- const req = request . apply ( this , arguments )
36+ try {
37+ const req = request . apply ( this , arguments )
3738
38- shimmer . wrap ( req , 'emit' , createWrapEmit ( ctx ) )
39+ shimmer . wrap ( req , 'emit' , createWrapEmit ( ctx ) )
3940
40- try {
4141 return req
4242 } catch ( e ) {
4343 ctx . error = e
Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ class TracingPlugin extends Plugin {
8787 const span = this . activeSpan
8888
8989 if ( ! span . _spanContext . _tags [ 'error' ] ) {
90+ // Errors may be wrapped in a context.
91+ error = ( error && error . error ) || error
9092 span . setTag ( 'error' , error || 1 )
9193 }
9294 }
You can’t perform that action at this time.
0 commit comments