Skip to content

Instantly share code, notes, and snippets.

@ryanmorr
Last active December 28, 2023 17:33
Show Gist options
  • Save ryanmorr/cf44c1e80723b48f91fdb4b4a25ba121 to your computer and use it in GitHub Desktop.
Save ryanmorr/cf44c1e80723b48f91fdb4b4a25ba121 to your computer and use it in GitHub Desktop.
Create a stacktrace
function stacktrace(error = new Error()) {
if (Error.captureStackTrace) {
Error.captureStackTrace(error, stacktrace);
return error.stack;
}
return error.stack;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment