Message from JavaScript discussions

December 2018

— With thenable you have a way to handle errors from the caller too


I could also implement a seperate function for the call adpater which bubbles all the way out, and keep spawn from ever throwing all the way out of the dispatcher

— console.error(error) vs throw error

— Nuuu

— Better to exit on unhandled error

— That is throw

— This is the dispatcher error handler code


if (block.stack.length === 0) {
debugLog("Stopping Dispatcher due to an uncaught error...\n");
throw error;

Message permanent page

— Just says "if call stack empty, throw the error up"

— So perhaps I will look into a thenable, but how will it run the callback?

— If the error happens concurrently, should the callback spawn as a new coroutine?


function tester() {
return 123;
const thenable = spawn tester();
thenable.then(value => doSomething).catch(error => doSomething);

Message permanent page