Skip to content

"EmptyEnvFileError" exception is fired when "isOptional" argument is passed #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
whiteGloom opened this issue May 8, 2024 · 0 comments

Comments

@whiteGloom
Copy link

whiteGloom commented May 8, 2024

When I try to load .env file which is completely empty, the load function ends with EmptyEnvFileError exception, even if I pass isOptional argument.

At the same time, when I load .env file with no variables at all:

# This file doesn't contain any variables, just a comments and empty lines

# No variables

, the "EmptyEnvFileError" isn't fired.

I believe that "no file at all", "completely empty file" and "file which doesn't contain variables" are equal cases, so all of them should work in same way with isOptional argument.

Moreover, when I'm getting error, I can't even understand what error it is exactly, because library doesn't export any error classes.

I can provide a pull request with fix for this problems, if no there is no objections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant