0

I am using express.js on node.js. I have used seneca microservices after promisifying them using bluebird hence making a promise chains with all my service calls.

Now, in the catch() block of my promise chain in case of an error an error object is passed which on console.error(err) prints:

[ReferenceError: number is not defined]

What kind of object is this?

console.error(JSON.stringify(err)); prints:

{}

console.log(err instanceof Array); prints:

false

console.log(Object.keys(err)); prints:

[]

console.log(typeof err); prints:

object

Also, how do I differentiate it from an empty {}?

Benjamin Gruenbaum
  • 270,886
  • 87
  • 504
  • 504
Surender Thakran
  • 3,958
  • 11
  • 47
  • 81

0 Answers0