maybestack

v2.0.0
maybestack(err) - return stack of error or just return the error object
error stack log return

maybestack

Returns error stack of an object if it exists.


import maybestack from 'maybestack'

const a = {a: 'ok'}
const b = new Error('stuff')

maybestack(a) // {a: 'ok'}
maybestack(b) /*
  Error: stuff
    at Error (native)
*/

npm i maybestack

Metadata

  • MIT
  • Whatever
  • ivan k
  • released 2/18/2016

Downloads

Maintainers