Skip to content

Instantly share code, notes, and snippets.

@pocotan001
Created October 25, 2016 06:35
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 pocotan001/4312ba7bfe85aa6e142794ee638040fd to your computer and use it in GitHub Desktop.
Save pocotan001/4312ba7bfe85aa6e142794ee638040fd to your computer and use it in GitHub Desktop.
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