mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(HTTP Request Node): Improve error handling for TCP socket errors when Continue On Fail is enabled (#6925)
This commit is contained in:
committed by
GitHub
parent
4e4a3cf7ab
commit
96ff1f847d
@@ -689,6 +689,8 @@ export async function proxyRequestToAxios(
|
||||
// https://github.com/axios/axios/blob/master/lib/core/enhanceError.js
|
||||
// Note: `code` is ignored as it's an expected part of the errorData.
|
||||
if (error.isAxiosError) {
|
||||
error.config = error.request = undefined;
|
||||
error.options = pick(config ?? {}, ['url', 'method', 'data', 'headers']);
|
||||
if (response) {
|
||||
Logger.debug('Request proxied to Axios failed', { status: response.status });
|
||||
let responseData = response.data;
|
||||
@@ -712,23 +714,14 @@ export async function proxyRequestToAxios(
|
||||
}
|
||||
}
|
||||
|
||||
const message = `${response.status as number} - ${JSON.stringify(responseData)}`;
|
||||
error.message = `${response.status as number} - ${JSON.stringify(responseData)}`;
|
||||
throw Object.assign(error, {
|
||||
message,
|
||||
statusCode: response.status,
|
||||
options: pick(config ?? {}, ['url', 'method', 'data', 'headers']),
|
||||
error: responseData,
|
||||
config: undefined,
|
||||
request: undefined,
|
||||
response: pick(response, ['headers', 'status', 'statusText']),
|
||||
});
|
||||
} else {
|
||||
if (error instanceof Error && error.message.includes('SSL routines'))
|
||||
throw new NodeSSLError(error);
|
||||
|
||||
throw Object.assign(error, {
|
||||
options: pick(config ?? {}, ['url', 'method', 'data', 'headers']),
|
||||
});
|
||||
} else if (error instanceof Error && error.message.includes('SSL routines')) {
|
||||
throw new NodeSSLError(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user