« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-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};
       };