-
-
Save kriszyp/258779 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
throw new Error("some error"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require.paths.push("."); | |
try{ | |
require("a"); | |
} | |
catch(e){ | |
require("sys").puts("Caught the error and now recovering"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node c.js | |
a.js:1 | |
__wrap__ = function (exports, require, module, __filename) { throw new Error( | |
^ | |
Error: some error | |
at Object.<anonymous> (a.js:1:72) | |
at [object Object].<anonymous> (node.js:893:21) | |
at [object Object].emitSuccess (node.js:260:13) | |
at [object Object].<anonymous> (node.js:648:21) | |
at [object Object].emitSuccess (node.js:260:13) | |
at node.js:509:29 | |
at [object Object].wait (node.js:326:11) | |
at require (node.js:880:32) | |
at Object.<anonymous> (/projects/node-sandbox/c.js:3:5) | |
at [object Object].<anonymous> (node.js:893:21) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment