Error indication when database not responding

I’ve successfully been able to create and access a MongoDB database on a local free version and the Atlas version from my localHost:3000 Node.js server. Now I’m testing my edge conditions by killing my local database (@ ‘’) to make sure I can handle those errors gracefully. The error returned does not seem to clearly identify . “database not found” condition in your standard error response on the Promise’s catch() function. As you can see from the code snippet below I need to know what to check against the (error.??? === ???) section (commented out to just print the error message) so I can then respawn the connect after a brief pause (which I would do forever after sending a database down message to admins).

Any help?

const connectPromise = this.mongoDatabase.connect();
connectPromise.catch((error)=> {
this.connectedToDatabaseState = this.databaseOperationalStates.ConnectionFailed;

  //if (error.??? === ???) {
  //  console.log(" Unable to connect to MongoDatabase, will retry", error);
 // }
 // else {

    console.log(" UnknownError from MongoDatabase Connect():: ", error);