mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(HTTP Request Node): Fix itemIndex in HTTP Request errors (#5991)
This commit is contained in:
parent
9693142985
commit
b351c62659
|
@ -967,7 +967,7 @@ export class HttpRequestV1 implements INodeType {
|
||||||
if (response!.status !== 'fulfilled') {
|
if (response!.status !== 'fulfilled') {
|
||||||
if (!this.continueOnFail()) {
|
if (!this.continueOnFail()) {
|
||||||
// throw error;
|
// throw error;
|
||||||
throw new NodeApiError(this.getNode(), response as JsonObject);
|
throw new NodeApiError(this.getNode(), response as JsonObject, { itemIndex });
|
||||||
} else {
|
} else {
|
||||||
// Return the actual reason as error
|
// Return the actual reason as error
|
||||||
returnItems.push({
|
returnItems.push({
|
||||||
|
|
|
@ -1019,7 +1019,7 @@ export class HttpRequestV2 implements INodeType {
|
||||||
if (response!.status !== 'fulfilled') {
|
if (response!.status !== 'fulfilled') {
|
||||||
if (!this.continueOnFail()) {
|
if (!this.continueOnFail()) {
|
||||||
// throw error;
|
// throw error;
|
||||||
throw new NodeApiError(this.getNode(), response as JsonObject);
|
throw new NodeApiError(this.getNode(), response as JsonObject, { itemIndex });
|
||||||
} else {
|
} else {
|
||||||
// Return the actual reason as error
|
// Return the actual reason as error
|
||||||
returnItems.push({
|
returnItems.push({
|
||||||
|
|
|
@ -1176,7 +1176,7 @@ export class HttpRequestV3 implements INodeType {
|
||||||
this.getNode(),
|
this.getNode(),
|
||||||
'JSON parameter need to be an valid JSON',
|
'JSON parameter need to be an valid JSON',
|
||||||
{
|
{
|
||||||
runIndex: itemIndex,
|
itemIndex,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1242,7 +1242,7 @@ export class HttpRequestV3 implements INodeType {
|
||||||
this.getNode(),
|
this.getNode(),
|
||||||
'JSON parameter need to be an valid JSON',
|
'JSON parameter need to be an valid JSON',
|
||||||
{
|
{
|
||||||
runIndex: itemIndex,
|
itemIndex,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1264,7 +1264,7 @@ export class HttpRequestV3 implements INodeType {
|
||||||
this.getNode(),
|
this.getNode(),
|
||||||
'JSON parameter need to be an valid JSON',
|
'JSON parameter need to be an valid JSON',
|
||||||
{
|
{
|
||||||
runIndex: itemIndex,
|
itemIndex,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1381,7 +1381,7 @@ export class HttpRequestV3 implements INodeType {
|
||||||
if (autoDetectResponseFormat && response.reason.error instanceof Buffer) {
|
if (autoDetectResponseFormat && response.reason.error instanceof Buffer) {
|
||||||
response.reason.error = Buffer.from(response.reason.error as Buffer).toString();
|
response.reason.error = Buffer.from(response.reason.error as Buffer).toString();
|
||||||
}
|
}
|
||||||
throw new NodeApiError(this.getNode(), response as JsonObject);
|
throw new NodeApiError(this.getNode(), response as JsonObject, { itemIndex });
|
||||||
} else {
|
} else {
|
||||||
// Return the actual reason as error
|
// Return the actual reason as error
|
||||||
returnItems.push({
|
returnItems.push({
|
||||||
|
|
Loading…
Reference in a new issue