Skip to content

Commit 4edb7ec

Browse files
committed
fix: address review feedback
1 parent 1229f51 commit 4edb7ec

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ const { flash } = require('./config/flash');
1818
*/
1919
try {
2020
process.loadEnvFile('.env.example');
21-
} catch {
22-
console.log('No .env.example file found. This is OK if the required environment variables are already set in your environment.');
21+
} catch (err) {
22+
if (err && err.code === 'ENOENT') {
23+
console.log('No .env.example file found. This is OK if the required environment variables are already set in your environment.');
24+
} else {
25+
console.error('Error loading .env.example file:', err);
26+
}
2327
}
2428

2529
/**

test/playwright.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const originalMongoUri = process.env.MONGODB_URI;
66
process.loadEnvFile(path.resolve(__dirname, '.env.test'));
77
// If MONGODB_URI was not set by the outer environment (originalMongoUri undefined)
88
// but was loaded from the env file, remove it so the memory-server starter can create a DB.
9-
if (originalMongoUri) {
9+
if (originalMongoUri !== undefined) {
1010
process.env.MONGODB_URI = originalMongoUri;
11-
} else if (process.env.MONGODB_URI) {
11+
} else if (process.env.MONGODB_URI !== undefined) {
1212
delete process.env.MONGODB_URI;
1313
}
1414

0 commit comments

Comments
 (0)