Skip to content

Instantly share code, notes, and snippets.

@zamnuts
Last active August 3, 2016 12:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zamnuts/848d2c3f5a33b8a3d022 to your computer and use it in GitHub Desktop.
Save zamnuts/848d2c3f5a33b8a3d022 to your computer and use it in GitHub Desktop.
enable break on exception
/*
* filename: index.js
* run: node--debug-brk index.js
* tested in node v0.10.30
*/
global.v8debug.Debug.setBreakOnException(); // enable it, global.v8debug is only defined when --debug flag is set
setTimeout(function() {
bogus(); // should break here, "`bogus` is not defined"
},2000);
@pyhedgehog
Copy link

global.v8debug.Debug.setBreakOnUncaughtException();

should be used to match you article name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment