Created
October 25, 2016 06:35
-
-
Save pocotan001/4312ba7bfe85aa6e142794ee638040fd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const error = new Error('unicorn') | |
const serialized = JSON.stringify(error, ['name', 'message', 'stack']) | |
console.log(error) // { name: 'Error', message: 'unicorn', stack: 'Error: unicorn\n at Object.<anonymous> …' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment