From abf2bbaec252a0f80e9deb22769a76650b58400e Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 27 Feb 2025 10:01:59 -0500 Subject: [PATCH] js: Very minor trimming. --- core/core.js | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/core/core.js b/core/core.js index c9841754..54deed7c 100644 --- a/core/core.js +++ b/core/core.js @@ -7,18 +7,17 @@ let kPingInterval = 60 * 1000; /** * TODOC - * @param {*} out * @param {*} error */ -function printError(out, error) { +function printError(error) { if (error.stackTrace) { - out.print(error.fileName + ':' + error.lineNumber + ': ' + error.message); - out.print(error.stackTrace); + print(error.fileName + ':' + error.lineNumber + ': ' + error.message); + print(error.stackTrace); } else { for (let [k, v] of Object.entries(error)) { - out.print(k, v); + print(k, v); } - out.print(error.toString()); + print(error.toString()); } } @@ -461,10 +460,10 @@ async function getProcessBlob(blobId, key, options) { if (process.app) { process.app.makeFunction(['error'])(error); } else { - printError({print: print}, error); + printError(error); } } catch (e) { - printError({print: print}, error); + printError(error); } }; imports.ssb = Object.fromEntries( @@ -687,7 +686,7 @@ async function getProcessBlob(blobId, key, options) { ); } } catch (e) { - printError({print: print}, e); + printError(e); } broadcastEvent('onSessionBegin', [getUser(process, process)]); if (process.app) { @@ -701,14 +700,10 @@ async function getProcessBlob(blobId, key, options) { sendStats(); } } catch (error) { - if (process.app) { - if (process?.task?.onError) { - process.task.onError(error); - } else { - printError({print: print}, error); - } + if (process?.app && process?.task?.onError) { + process.task.onError(error); } else { - printError({print: print}, error); + printError(error); } rejectReady(error); }