Twaha-Rahman/e-commercify

[BUG] Data Injector has an uncaught error for failed MongoDB connection

Closed this issue · 1 comments

Describe the bug

Currently if the data injector script fails to connect to MongoDB, it throws an uncaught error.

To Reproduce
How can we reproduce this bug?

  1. Remove the .env file or change the mongo-url in the file to an invalid link
  2. Run npm run fill-db
  3. See the error in the console

Expected behavior

We need to catch that error and log it and exit process.

#54 fixed this bug.