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

refactor: print nicer error to load config error #428

Conversation

KarolosLykos
Copy link
Contributor

log.Panicf("failed to read config: %v", err)
}
err = yaml.Unmarshal(data, &config)
if err != nil {
log.Panicf("failed to parse config: %v", err)

This is a fairly common failure case and it should be pretty obvious to the user how to resolve it, there's no need for the stack trace we get with log.Panicf, let's use exit.Fatal instead.

.idea/modules.xml Outdated Show resolved Hide resolved
@bmonkman
Copy link
Contributor

Awesome, thank you! Just one request.

@bmonkman bmonkman linked an issue Oct 22, 2021 that may be closed by this pull request
@bmonkman
Copy link
Contributor

You'll also have to remove the files that were added in the previous commit.

Copy link
Contributor

@bmonkman bmonkman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@bmonkman bmonkman merged commit 5250229 into commitdev:main Oct 27, 2021
@KarolosLykos KarolosLykos deleted the issue-427-print_nicer_error_to_load_config branch November 17, 2021 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print nicer error when failing to load project config
2 participants