UNPKG

@n8n/n8n-nodes-langchain

Version:
14 lines • 593 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isToolErrorResult = isToolErrorResult; const is_record_1 = require("@n8n/utils/is-record"); function isToolErrorResult(result) { if ((0, is_record_1.isRecord)(result) && 'error' in result) { return (0, is_record_1.isRecord)(result.error) && typeof result.error.message === 'string'; } if (typeof result === 'string') { return /^(\w+Error: |HTTP \d{3} There was an error: |There was an error: )/.test(result); } return false; } //# sourceMappingURL=tool-error-result.js.map