« get me outta code hell

infra: skip redundant stack frame for relations error tracing - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-02 12:11:32 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-08-02 12:11:32 -0300
commita88b415391b1c191292a9a0aa7e40152066483e2 (patch)
tree5f39b0ea4a93bce098cf17350457e2f0a76dcf24 /src
parentdc24e6200291caaf3aed5ac4aef8096c1ace47c4 (diff)
infra: skip redundant stack frame for relations error tracing
Diffstat (limited to 'src')
-rw-r--r--src/content-function.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/content-function.js b/src/content-function.js
index 9dbea5c7..443715dc 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};
       };