n8n-workflow
Advanced tools
Comparing version 0.149.0 to 0.150.0
@@ -329,3 +329,3 @@ /// <reference types="node" /> | ||
export interface IN8nHttpFullResponse { | ||
body: IN8nHttpResponse; | ||
body: IN8nHttpResponse | Readable; | ||
headers: IDataObject; | ||
@@ -332,0 +332,0 @@ statusCode: number; |
import type { IDataObject, INode, JsonObject } from './Interfaces'; | ||
type Severity = 'warning' | 'error'; | ||
interface ExecutionBaseErrorOptions { | ||
@@ -14,4 +15,5 @@ cause?: Error | JsonObject; | ||
} | ||
declare abstract class NodeError extends ExecutionBaseError { | ||
export declare abstract class NodeError extends ExecutionBaseError { | ||
node: INode; | ||
severity: Severity; | ||
constructor(node: INode, error: Error | JsonObject); | ||
@@ -27,2 +29,3 @@ protected findProperty(jsonError: JsonObject, potentialKeys: string[], traversalKeys?: string[]): string | null; | ||
itemIndex?: number; | ||
severity?: Severity; | ||
} | ||
@@ -40,3 +43,3 @@ export declare class NodeOperationError extends NodeError { | ||
httpCode: string | null; | ||
constructor(node: INode, error: JsonObject, { message, description, httpCode, parseXml, runIndex, itemIndex }?: NodeApiErrorOptions); | ||
constructor(node: INode, error: JsonObject, { message, description, httpCode, parseXml, runIndex, itemIndex, severity, }?: NodeApiErrorOptions); | ||
private setDescriptionFromXml; | ||
@@ -43,0 +46,0 @@ private setMessage; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NodeApiError = exports.NodeOperationError = exports.ExecutionBaseError = void 0; | ||
exports.NodeApiError = exports.NodeOperationError = exports.NodeError = exports.ExecutionBaseError = void 0; | ||
const xml2js_1 = require("xml2js"); | ||
@@ -71,2 +71,3 @@ const ERROR_MESSAGE_PROPERTIES = [ | ||
super(message, { cause: error }); | ||
this.severity = 'error'; | ||
this.node = node; | ||
@@ -148,2 +149,3 @@ } | ||
} | ||
exports.NodeError = NodeError; | ||
class NodeOperationError extends NodeError { | ||
@@ -155,5 +157,6 @@ constructor(node, error, options = {}) { | ||
super(node, error); | ||
if (options.message) { | ||
if (options.message) | ||
this.message = options.message; | ||
} | ||
if (options.severity) | ||
this.severity = options.severity; | ||
this.description = options.description; | ||
@@ -184,5 +187,9 @@ this.context.runIndex = options.runIndex; | ||
class NodeApiError extends NodeError { | ||
constructor(node, error, { message, description, httpCode, parseXml, runIndex, itemIndex } = {}) { | ||
constructor(node, error, { message, description, httpCode, parseXml, runIndex, itemIndex, severity, } = {}) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
super(node, error); | ||
if (severity) | ||
this.severity = severity; | ||
else if ((httpCode === null || httpCode === void 0 ? void 0 : httpCode.charAt(0)) !== '5') | ||
this.severity = 'warning'; | ||
if (error.error) { | ||
@@ -189,0 +196,0 @@ this.removeCircularRefs(error.error); |
@@ -45,3 +45,3 @@ "use strict"; | ||
async runNode(inputData, runIndex, nodeType, executeData, nodeExecuteFunctions, credentialsDecrypted) { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
const items = inputData.main[0]; | ||
@@ -113,2 +113,4 @@ const returnData = []; | ||
} | ||
if (error instanceof NodeErrors_1.NodeApiError) | ||
error = error.cause; | ||
throw new NodeErrors_1.NodeApiError(this.node, error, { | ||
@@ -119,2 +121,3 @@ runIndex, | ||
description: error === null || error === void 0 ? void 0 : error.description, | ||
httpCode: error.isAxiosError && error.response && String((_c = error.response) === null || _c === void 0 ? void 0 : _c.status), | ||
}); | ||
@@ -121,0 +124,0 @@ } |
{ | ||
"name": "n8n-workflow", | ||
"version": "0.149.0", | ||
"version": "0.150.0", | ||
"description": "Workflow base code of n8n", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.md", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
654803
8894