You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// It's important to note that it WILL NOT OVERRIDE an env variable that already exists - consider the .env file to set dev vars or sensible defaults
func Load(filenames ...string) (err error) {
filenames = filenamesOrDefault(filenames)
for _, filename := range filenames {
err = loadFile(filename, false)
if err != nil {
return // return early on a spazout
}
}
return
}
the return // return early on a spazout behavior is questionable, in my opinion. I think it should show a normal error somehow, since it makes things easier to debug.
In my case it turned out to be an error with env file being parsed, since I had an accidental newline in one of the variables. However I couldn't figure this out without going into the dotenv source code and adding some logger statements.
The text was updated successfully, but these errors were encountered:
maxp-edcast
changed the title
Meaningful error when it can't find the dotenv file
error when it can't find the dotenv file
Nov 16, 2018
maxp-edcast
changed the title
error when it can't find the dotenv file
should have error when it can't find the dotenv file?
Nov 16, 2018
maxp-edcast
changed the title
should have error when it can't find the dotenv file?
Proper error when it can't find or parse the dotenv file
Nov 16, 2018
Were you checking the returned err from the function? I wrote that a long time ago and it's in the now very non-idiomatic named/naked return so the error should be available.
In the source code we have
the
return // return early on a spazout
behavior is questionable, in my opinion. I think it should show a normal error somehow, since it makes things easier to debug.In my case it turned out to be an error with env file being parsed, since I had an accidental newline in one of the variables. However I couldn't figure this out without going into the dotenv source code and adding some logger statements.
The text was updated successfully, but these errors were encountered: