Skip to content

Instantly share code, notes, and snippets.

@lykkin
Created June 26, 2017 23:21
Show Gist options
  • Save lykkin/ee9fc460060ffe7d7625b425d9ee49c2 to your computer and use it in GitHub Desktop.
Save lykkin/ee9fc460060ffe7d7625b425d9ee49c2 to your computer and use it in GitHub Desktop.
long stacks
var oldNextTick = process.nextTick
process.nextTick = function(cb) {
var stack = (new Error()).stack
return oldNextTick.call(process, function() {
try {
return cb.apply(this, arguments)
} catch (e) {
e.stack = stack + e.stack
throw e
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment