Skip to content

Commit 717cbf0

Browse files
committed
Fix typings in HttpClient.middlewares.tracing
Once again, only make error handling if we're actually dealing with an AxiosError
1 parent f3926fb commit 717cbf0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/HttpClient/middlewares/tracing.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { AxiosError } from 'axios'
12
import { MiddlewaresTracingContext, RequestConfig } from '..'
23
import { IOContext } from '../../service/worker/runtime/typings'
34
import { ErrorReport, getTraceInfo } from '../../tracing'
@@ -63,6 +64,9 @@ export const createHttpClientTracingMiddleware = ({
6364
await next()
6465
response = ctx.response
6566
} catch (err) {
67+
if (!(err instanceof AxiosError)) {
68+
throw err
69+
}
6670
response = err.response
6771
if(ctx.tracing?.isSampled) {
6872
ErrorReport.create({ originalError: err }).injectOnSpan(span, logger)

0 commit comments

Comments
 (0)