Skip to content

Instantly share code, notes, and snippets.

@jastisriradheshyam
Last active April 14, 2020 11:17
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 jastisriradheshyam/1d9a50a4b5fe40c6f644158f7922985d to your computer and use it in GitHub Desktop.
Save jastisriradheshyam/1d9a50a4b5fe40c6f644158f7922985d to your computer and use it in GitHub Desktop.
Node JS, full error object to string
// node.js error object to string
const util = require('util')
var fullErrorObjectString = "";
try {
k++
} catch (error) {
console.log(util.inspect(error, false, null, false /* enable colors */))
fullErrorObjectString = util.inspect(error, false, null, false /* enable colors */).toString()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment