Skip to content

Instantly share code, notes, and snippets.

@kriszyp
Created December 17, 2009 14:34
Show Gist options
  • Save kriszyp/258779 to your computer and use it in GitHub Desktop.
Save kriszyp/258779 to your computer and use it in GitHub Desktop.
throw new Error("some error");
require.paths.push(".");
try{
require("a");
}
catch(e){
require("sys").puts("Caught the error and now recovering");
}
$ 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