Skip to content

Commit 62c931c

Browse files
committed
Improve dotenv file loading error message
1 parent faae232 commit 62c931c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cli/env_file.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ func loadEnvFromFile(path string) error {
1414
if err != nil {
1515
return fmt.Errorf("failed to get absolute path for %s: %v", path, err)
1616
}
17-
if godotenv.Load(path) != nil {
18-
return fmt.Errorf("failed to load env file from %s", absolutePath)
17+
if err := godotenv.Load(path); err != nil {
18+
return fmt.Errorf("failed to load env file from %s: %v", absolutePath, err)
1919
}
2020
slog.Info("loading environment variables from file", "path", absolutePath)
2121
}

0 commit comments

Comments
 (0)