Ticket, Handling Errors

I am not aware of this as of yet. But I would recommend searching in docs.mongodb.com. For example, when I searched for E11001 in docs website, then these links came up which might be useful:

https://docs.mongodb.com/manual/reference/exit-codes/?searchProperty=current&query=E11000

Let me know if it helps! :slight_smile:

Kanika

Just in case someone else can benefit from what I just learned. I attempted to console.log the properties of e and found it completely frustrating. I couldn’t use Object.keys to list out the properties. Researching the MongoDb documentation, I concluded it was an object of type MongoError. This has the properties of message and stack. It also has the property name whose value is 'Error'.

The frustration was due to the strangeness of Error objects in Javascript. This very old thread addresses the issue. Why can’t I see the keys of an Error object?

Three years of Javascript programming and still learning new things.

2 Likes

This is great! Thanks for sharing @William_Moore_97877 :slight_smile:

Kanika