From b1eff5570116c7e95ea3fea915b8e1f59cf02fba Mon Sep 17 00:00:00 2001 From: vamsi Date: Sun, 29 Mar 2026 00:53:23 +0530 Subject: [PATCH] Fix nouveau handleIndexError crash on QuickJS Replace SpiderMonkey-specific err.toSource() with the cross-engine errstr() helper in nouveau.js handleIndexError(). The errstr() function (defined in util.js) safely checks for toSource availability before calling it, falling back to toString(). This is consistent with the identical pattern used in dreyfus.js handleIndexError(). Without this fix, any non-fatal error thrown by a Nouveau index function on QuickJS causes the error handler itself to crash with a TypeError, preventing graceful error logging and document skipping. --- share/server/nouveau.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/server/nouveau.js b/share/server/nouveau.js index 8c75d4a2502..474e94c874b 100644 --- a/share/server/nouveau.js +++ b/share/server/nouveau.js @@ -20,7 +20,7 @@ var Nouveau = (function () { } else if (err[0] == "fatal") { throw (err); } - var message = "function raised exception " + err.toSource(); + var message = "function raised exception " + errstr(err); if (doc) message += " with doc._id " + doc._id; log(message); };