mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
output error details in axios client
This commit is contained in:
parent
9516ce1aa6
commit
a310352d82
@ -121,8 +121,9 @@ async function getBatchEmbeddingsWithRetry(
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": `Bearer ${JINA_API_KEY}`
|
||||
}
|
||||
}
|
||||
},
|
||||
timeout: 60000,
|
||||
},
|
||||
);
|
||||
|
||||
if (!response.data.data) {
|
||||
|
||||
@ -55,6 +55,18 @@ const axiosClient = axios.create(baseConfig);
|
||||
axiosClient.interceptors.response.use(
|
||||
(response) => response,
|
||||
(error) => {
|
||||
logError('Request error:', {
|
||||
details: {
|
||||
url: error.config.url,
|
||||
payload: error.config.data,
|
||||
message: error.message,
|
||||
code: error.code,
|
||||
response: error.response ? {
|
||||
status: error.response.status,
|
||||
data: error.response.data,
|
||||
} : undefined,
|
||||
}
|
||||
});
|
||||
if (error.code === 'ECONNABORTED') {
|
||||
error.request?.destroy?.();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user