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

Provide a reasonable error message to users #80

Merged
merged 1 commit into from Jun 14, 2019

Conversation

Projects
None yet
2 participants
@schancel
Copy link
Contributor

commented Jun 6, 2019

Currently, when the .env file cannot be parsed, the dbmate application
bombs with no explanation. This commit prints out the error.

@amacneil
Copy link
Owner

left a comment

thanks for the pr! one small comment

main.go Outdated
@@ -123,7 +123,7 @@ func loadDotEnv() {
}

if err := godotenv.Load(); err != nil {
log.Fatal("Error loading .env file")
log.Fatalf("Error loading .env file: %q", err.Error())

This comment has been minimized.

Copy link
@amacneil

amacneil Jun 7, 2019

Owner

How does this print? I think just %s would be sufficient?

This comment has been minimized.

Copy link
@schancel

schancel Jun 7, 2019

Author Contributor

Yes. It prints with quotes around it currently.

This comment has been minimized.

Copy link
@amacneil

amacneil Jun 10, 2019

Owner

Can you remove the quotes to make consistent with our other error messages?

Also - do you have an example of an error this would print?

This comment has been minimized.

Copy link
@schancel

schancel Jun 14, 2019

Author Contributor

In my case it was erroring as such:

2019/06/13 19:51:46 Error loading .env file: Can't separate key from value
Shammah Chancellor
Provide a reasonable error message to users
Currently, when the .env file cannot be parsed, the dbmate application
bombs with no explanation.  This commit prints out the error.

@schancel schancel force-pushed the schancel:master branch from bfa85d6 to 73e5dda Jun 14, 2019

@amacneil
Copy link
Owner

left a comment

lgtm, thanks!

@amacneil amacneil merged commit 2c83de3 into amacneil:master Jun 14, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.