Skip to content
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

fix: Print dotenv file path when there is an error reading file #1842

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

pbitty
Copy link
Contributor

@pbitty pbitty commented Sep 27, 2024

Fixes #1261.

@pbitty pbitty force-pushed the issue-1261_dotenv_error_message branch from 4e853fb to 326e7f5 Compare September 27, 2024 21:39
expected := fmt.Sprintf("error reading env file %s:", path)

err := e.Setup()
require.ErrorContains(t, err, expected)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used ErrorContains() and only included the part of the error message that we add, so that the tests wouldn't depend on the exact wording coming from the dotenv library.

@vmaerten vmaerten self-requested a review September 29, 2024 20:03
@vmaerten
Copy link
Member

Thanks!

@vmaerten vmaerten merged commit 8d0f0b0 into go-task:main Sep 29, 2024
14 checks passed
vmaerten added a commit that referenced this pull request Sep 29, 2024
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

Successfully merging this pull request may close these issues.

Unusable error message for invalid .env file
2 participants