Skip to content

Commit d80db2f

Browse files
authored
fix(config): catch profile error even when env vars are set (#2757)
1 parent ec33e54 commit d80db2f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

internal/core/client.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ func createClient(ctx context.Context, httpClient *http.Client, buildInfo *Build
3838
return nil, err
3939
}
4040

41+
// Creates a client from the active profile
42+
// It will trigger a validation step on its configuration to catch errors if any
43+
opts := []scw.ClientOption{
44+
scw.WithProfile(activeProfile),
45+
}
46+
47+
_, err = scw.NewClient(opts...)
48+
if err != nil {
49+
return nil, err
50+
}
51+
4152
profile = scw.MergeProfiles(activeProfile, profile)
4253
}
4354

0 commit comments

Comments
 (0)