js: Very minor trimming.

This commit is contained in:
Cory McWilliams 2025-02-27 10:01:59 -05:00
parent 0da7e2722f
commit abf2bbaec2

View File

@ -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);
}