From 2df3e2220ba7118f1e9e9804866f609da1b5f05b Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Fri, 7 Jul 2023 15:06:07 +0200 Subject: [PATCH] fix(tracker): add guard for axios empty response on error --- tracker/tracker/src/main/modules/axiosSpy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracker/tracker/src/main/modules/axiosSpy.ts b/tracker/tracker/src/main/modules/axiosSpy.ts index 774cd6919..62dd46c17 100644 --- a/tracker/tracker/src/main/modules/axiosSpy.ts +++ b/tracker/tracker/src/main/modules/axiosSpy.ts @@ -172,7 +172,7 @@ export default function ( function captureNetworkError(error: Record) { app.debug.log('Openreplay: capturing API request error', error) - if (isAxiosError(error)) { + if (isAxiosError(error) && Boolean(error.response)) { captureResponseData(error.response as AxiosResponse) } else if (error instanceof Error) { app.send(getExceptionMessage(error, []))