From a88b415391b1c191292a9a0aa7e40152066483e2 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 2 Aug 2023 12:11:32 -0300 Subject: infra: skip redundant stack frame for relations error tracing --- src/content-function.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/content-function.js b/src/content-function.js index 9dbea5c..443715d 100644 --- a/src/content-function.js +++ b/src/content-function.js @@ -377,8 +377,14 @@ export function getRelationsTree(dependencies, contentFunctionName, wikiData, .. } const relationSymbol = Symbol(relationSymbolMessage(name)); + + const {stackTraceLimit} = Error; + Error.stackTraceLimit = 0; const subCause = new Error(`Error in relation('${name}') within ${contentFunctionName}`); + Error.stackTraceLimit = stackTraceLimit; + Error.captureStackTrace(subCause, relationFunction); if (superCause) subCause.cause = superCause; + relationSlots[relationSymbol] = {name, args, cause: subCause}; return {[relationIdentifier]: relationSymbol}; }; -- cgit 1.3.0-6-gf8a5