Skip to content
/ qp-n8n Public
forked from n8n-io/n8n

Commit

Permalink
fix(HTTP Request Node): Fix itemIndex in HTTP Request errors (n8n-io#…
Browse files Browse the repository at this point in the history
  • Loading branch information
janober authored and sunilrr committed Apr 24, 2023
1 parent c2220a5 commit 0d7fdc0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ export class HttpRequestV1 implements INodeType {
if (response!.status !== 'fulfilled') {
if (!this.continueOnFail()) {
// throw error;
throw new NodeApiError(this.getNode(), response as JsonObject);
throw new NodeApiError(this.getNode(), response as JsonObject, { itemIndex });
} else {
// Return the actual reason as error
returnItems.push({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ export class HttpRequestV2 implements INodeType {
if (response!.status !== 'fulfilled') {
if (!this.continueOnFail()) {
// throw error;
throw new NodeApiError(this.getNode(), response as JsonObject);
throw new NodeApiError(this.getNode(), response as JsonObject, { itemIndex });
} else {
// Return the actual reason as error
returnItems.push({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ export class HttpRequestV3 implements INodeType {
this.getNode(),
'JSON parameter need to be an valid JSON',
{
runIndex: itemIndex,
itemIndex,
},
);
}
Expand Down Expand Up @@ -1242,7 +1242,7 @@ export class HttpRequestV3 implements INodeType {
this.getNode(),
'JSON parameter need to be an valid JSON',
{
runIndex: itemIndex,
itemIndex,
},
);
}
Expand All @@ -1264,7 +1264,7 @@ export class HttpRequestV3 implements INodeType {
this.getNode(),
'JSON parameter need to be an valid JSON',
{
runIndex: itemIndex,
itemIndex,
},
);
}
Expand Down Expand Up @@ -1381,7 +1381,7 @@ export class HttpRequestV3 implements INodeType {
if (autoDetectResponseFormat && response.reason.error instanceof Buffer) {
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 {
// Return the actual reason as error
returnItems.push({
Expand Down

0 comments on commit 0d7fdc0

Please sign in to comment.