Skip to content Skip to sidebar Skip to footer

Node.js - Domain Per Express Request, Inside Another Domain

Error handling in Node. Argh! I'm trying to layout a basic Node app like this... Cluster -> Worker -> Server Domain -> Express Request Domain So, if an error is thrown 1

Solution 1:

Ok, solved - Express has a try/catch block, which is getting to my non-existent function call first.

To have the domain catch it, it needs to be taken out of the current call stack, like...

        process.nextTick(function() {
            this_function_does_not_exist();
            res.end('we will never get here');
        });

THEN the domain will grab it.

Post a Comment for "Node.js - Domain Per Express Request, Inside Another Domain"