{"record":{"id":"3078d8d4d1109788","repo":"FlowiseAI/Flowise","slug":"failed-to-call-method-error-message","errorCode":null,"errorMessage":"Failed to call ${method}: ${error.message}","messagePattern":"Failed to call (.+?): (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/vectorstores/Supabase/filterParser.ts","lineNumber":196,"sourceCode":"            throw new Error(`Potentially dangerous argument: ${arg}`)\n        }\n\n        return arg\n    }\n\n    private static buildFilterFunction(chain: Array<{ method: string; args: any[] }>): (rpc: any) => any {\n        return (rpc: any) => {\n            let result = rpc\n\n            for (const { method, args } of chain) {\n                if (typeof result[method] !== 'function') {\n                    throw new Error(`Method ${method} is not available on the RPC object`)\n                }\n\n                try {\n                    result = result[method](...args)\n                } catch (error) {\n                    throw new Error(`Failed to call ${method}: ${error.message}`)\n                }\n            }\n\n            return result\n        }\n    }\n}\n","sourceCodeStart":178,"sourceCodeEnd":204,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/vectorstores/Supabase/filterParser.ts#L178-L204","documentation":"Inside the built filter function, each `result[method](...args)` call is wrapped in its own try/catch; if the method throws (wrong arg types, value coercion, PostgREST-level error), it re-throws as 'Failed to call ${method}: ${error.message}'. This converts builder-call-time failures into a uniform message, again losing the original error object.","triggerScenarios":"Calling `filter` with wrong arg types (non-string column, invalid operator at runtime), `limit` with non-number, `range` with bad indices, or any builder method rejecting the supplied args at runtime.","commonSituations":"Argument types correct at parse time but wrong at call time (e.g. number vs string); column referenced does not exist on the table; operator semantics rejected by PostgREST.","solutions":["Match argument types to the method contract (filter: string,string,any; limit: number; range: number,number).","Verify referenced columns exist on the target table/RPC.","Inspect the appended inner message to find which method and why.","Coerce/validate args before building the filter string."],"exampleFix":"// before: 'limit(\"ten\")' -> Failed to call limit: ...\n// after: 'limit(10)'","handlingStrategy":"try-catch","validationCode":"function coerceArgs(method: string, args: any[]): any[] {\n  if (method === 'limit') return [Number(args[0])]\n  if (method === 'range') return [Number(args[0]), Number(args[1])]\n  return args\n}","typeGuard":"null","tryCatchPattern":"try { result = result[method](...coerceArgs(method, args)) } catch (e) { throw new Error(`Call '${method}' failed: ${(e as Error).message}`, { cause: e }) }","preventionTips":["Match argument types to each method's contract.","Verify referenced columns exist on the table/RPC.","Read the appended inner message to localize the failing method.","Coerce numbers for limit/range before building the filter."],"tags":["supabase","filter-parser","runtime","input-validation","typescript"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}