Skip to content

Commit a310352

Browse files
committed
output error details in axios client
1 parent 9516ce1 commit a310352

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/tools/embeddings.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ async function getBatchEmbeddingsWithRetry(
121121
headers: {
122122
"Content-Type": "application/json",
123123
"Authorization": `Bearer ${JINA_API_KEY}`
124-
}
125-
}
124+
},
125+
timeout: 60000,
126+
},
126127
);
127128

128129
if (!response.data.data) {

src/utils/axios-client.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ const axiosClient = axios.create(baseConfig);
5555
axiosClient.interceptors.response.use(
5656
(response) => response,
5757
(error) => {
58+
logError('Request error:', {
59+
details: {
60+
url: error.config.url,
61+
payload: error.config.data,
62+
message: error.message,
63+
code: error.code,
64+
response: error.response ? {
65+
status: error.response.status,
66+
data: error.response.data,
67+
} : undefined,
68+
}
69+
});
5870
if (error.code === 'ECONNABORTED') {
5971
error.request?.destroy?.();
6072
}

0 commit comments

Comments
 (0)