Last active
April 14, 2020 11:17
-
-
Save jastisriradheshyam/1d9a50a4b5fe40c6f644158f7922985d to your computer and use it in GitHub Desktop.
Node JS, full error object to string
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
// 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