Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var domain = require("domain");
- var d = domain.create();
- d.on("error", function() {
- console.log("domain caught");
- });
- try {
- d.run(function() {
- process.nextTick(function() {
- throw new Error("foo");
- });
- });
- } catch (err) {
- console.log("try/catch caught");
- }
- // result: domain caught
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement