mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(HTTP Request Node): Show detailed error message in the UI again (#5959)
This commit is contained in:
committed by
GitHub
parent
60d28fc761
commit
e79679c023
@@ -578,7 +578,13 @@ function digestAuthAxiosConfig(
|
||||
return axiosConfig;
|
||||
}
|
||||
|
||||
async function proxyRequestToAxios(
|
||||
type ConfigObject = {
|
||||
auth?: { sendImmediately: boolean };
|
||||
resolveWithFullResponse?: boolean;
|
||||
simple?: boolean;
|
||||
};
|
||||
|
||||
export async function proxyRequestToAxios(
|
||||
workflow: Workflow,
|
||||
additionalData: IWorkflowExecuteAdditionalData,
|
||||
node: INode,
|
||||
@@ -598,12 +604,6 @@ async function proxyRequestToAxios(
|
||||
maxBodyLength: Infinity,
|
||||
maxContentLength: Infinity,
|
||||
};
|
||||
|
||||
type ConfigObject = {
|
||||
auth?: { sendImmediately: boolean };
|
||||
resolveWithFullResponse?: boolean;
|
||||
simple?: boolean;
|
||||
};
|
||||
let configObject: ConfigObject;
|
||||
if (uriOrObject !== undefined && typeof uriOrObject === 'string') {
|
||||
axiosConfig.url = uriOrObject;
|
||||
@@ -707,12 +707,17 @@ async function proxyRequestToAxios(
|
||||
}
|
||||
|
||||
const message = `${response.status as number} - ${JSON.stringify(responseData)}`;
|
||||
throw Object.assign(new Error(message, { cause: error }), {
|
||||
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 {
|
||||
throw Object.assign(new Error(error.message, { cause: error }), {
|
||||
throw Object.assign(error, {
|
||||
options: pick(config ?? {}, ['url', 'method', 'data', 'headers']),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user