src: fix loadEnvFile ENOENT error by fahrradflucht · Pull Request #52438 · nodejs/node

@nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

needs-ci

PRs that need a full CI run.

labels

Apr 9, 2024

anonrig

@fahrradflucht

Before this change the error message for `process.loadEnvFile()` without
an `.env` file present in the current working directory was looking like
this: `ENOENT: .env, Failed to load '%s'.` This obviously isn't what the
author intended.

To fix that, just return a "plain" ENOENT open error. It should be
descriptive enough. That means for the above example, the error message
is now `ENOENT: no such file or directory, open '.env'`.

@anonrig anonrig added request-ci

Add this label to start a Jenkins CI on a PR.

author ready

PRs that have at least one approval, no pending requests for changes, and a CI started.

labels

Apr 10, 2024

@targos targos linked an issue

Apr 11, 2024

that may be closed by this pull request

@anonrig anonrig added commit-queue

Add this label to land a pull request using GitHub Actions.

and removed commit-queue

Add this label to land a pull request using GitHub Actions.

labels

Apr 17, 2024

aduh95 pushed a commit that referenced this pull request

Apr 29, 2024
Before this change the error message for `process.loadEnvFile()` without
an `.env` file present in the current working directory was looking like
this: `ENOENT: .env, Failed to load '%s'.` This obviously isn't what the
author intended.

To fix that, just return a "plain" ENOENT open error. It should be
descriptive enough. That means for the above example, the error message
is now `ENOENT: no such file or directory, open '.env'`.

PR-URL: #52438
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>

marco-ippolito pushed a commit that referenced this pull request

May 2, 2024
Before this change the error message for `process.loadEnvFile()` without
an `.env` file present in the current working directory was looking like
this: `ENOENT: .env, Failed to load '%s'.` This obviously isn't what the
author intended.

To fix that, just return a "plain" ENOENT open error. It should be
descriptive enough. That means for the above example, the error message
is now `ENOENT: no such file or directory, open '.env'`.

PR-URL: #52438
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>

marco-ippolito pushed a commit that referenced this pull request

May 3, 2024
Before this change the error message for `process.loadEnvFile()` without
an `.env` file present in the current working directory was looking like
this: `ENOENT: .env, Failed to load '%s'.` This obviously isn't what the
author intended.

To fix that, just return a "plain" ENOENT open error. It should be
descriptive enough. That means for the above example, the error message
is now `ENOENT: no such file or directory, open '.env'`.

PR-URL: #52438
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>