-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
DO NOT MERGE (needs review and testing). Break error into parts #715
base: main
Are you sure you want to change the base?
Changes from 5 commits
f19ad69
d36cbf0
92678a9
83674d1
2bc991d
a08d257
4496b1c
f2ba630
0ec4c03
f7cc62e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -13,6 +13,7 @@ import ( | |||||||||||||
e "github.com/cloudposse/atmos/internal/exec" | ||||||||||||||
tuiUtils "github.com/cloudposse/atmos/internal/tui/utils" | ||||||||||||||
cfg "github.com/cloudposse/atmos/pkg/config" | ||||||||||||||
"github.com/cloudposse/atmos/pkg/logger" | ||||||||||||||
"github.com/cloudposse/atmos/pkg/schema" | ||||||||||||||
u "github.com/cloudposse/atmos/pkg/utils" | ||||||||||||||
) | ||||||||||||||
|
@@ -71,7 +72,8 @@ func Execute() error { | |||||||||||||
if err != nil && !errors.Is(err, cfg.NotFound) { | ||||||||||||||
u.LogErrorAndExit(schema.CliConfiguration{}, err) | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
// Set the log level for IError interface | ||||||||||||||
logger.SetPrintDebugPart(cliConfig.Logs.Level) | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) LGTM: Setting log level for IError interface. The new line correctly sets the log level for the However, consider adding error handling for the Consider updating the code as follows: // Set the log level for IError interface
-logger.SetPrintDebugPart(cliConfig.Logs.Level)
+if err := logger.SetPrintDebugPart(cliConfig.Logs.Level); err != nil {
+ u.LogErrorAndExit(err)
+} 📝 Committable suggestion
Suggested change
|
||||||||||||||
// If CLI configuration was found, process its custom commands and command aliases | ||||||||||||||
if err == nil { | ||||||||||||||
err = processCustomCommands(cliConfig, cliConfig.Commands, RootCmd, true) | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have
cliConfig
, let's use it (I missed this line in the previous PR)