-
-
Save joliss/5656383 to your computer and use it in GitHub Desktop.
This file contains 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
function MyError() { | |
Error.apply(this, arguments); | |
} | |
MyError.prototype = new Error(); | |
MyError.prototype.constructor = MyError; | |
MyError.prototype.name = 'MyError'; | |
console.log((new MyError('foo!')).stack) |
This file contains 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
MyError | |
at Object.<anonymous> (/home/ubuntu/src/test.js:5:21) <------- should be line 9 instead of 5! | |
at Module._compile (module.js:456:26) | |
at Object.Module._extensions..js (module.js:474:10) | |
at Module.load (module.js:356:32) | |
at Function.Module._load (module.js:312:12) | |
at Function.Module.runMain (module.js:497:10) | |
at startup (node.js:119:16) | |
at node.js:901:3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment