Skip to content

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

@whiteGloom

Description

@whiteGloom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions