simnova / ownercommunity

MIT License
2 stars 1 forks source link

**suggestion:** Potential error handling for dotenv #136

Open nguyenduy opened 1 month ago

nguyenduy commented 1 month ago
          **suggestion:** Potential error handling for dotenv

Consider adding error handling for the dotenv configuration to catch and log any issues that might arise from loading the .env file.

const result = require('dotenv').config();
if (result.error) {
  console.error('Error loading .env file:', result.error);
  process.exit(1);
}

_Originally posted by @sourcery-ai[bot] in https://github.com/simnova/ownercommunity/pull/135#discussion_r1629623985_