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

main: display an error message instead of panic when setup fails #284

Merged
merged 1 commit into from Sep 13, 2018

Conversation

Projects
None yet
2 participants
@mingrammer
Copy link
Contributor

commented Sep 13, 2018

lazygit is not a library, but jsut CLI for end users. So it does not need to raise panic when config/setup fails.

For example, if I run lazygit in non-git directory, I'll get a following result:

panic: fatal: not a git repository (or any of the parent directories): .git


goroutine 1 [running]:
main.main()
	/go/src/github.com/jesseduffield/lazygit/main.go:49 +0x470

It seems like a bug! We can just show error message without panic, like this:

2018/09/14 00:29:55 fatal: not a git repository (or any of the parent directories): .git
@jesseduffield

This comment has been minimized.

Copy link
Owner

commented Sep 13, 2018

LGTM :) Thanks for making this!

@jesseduffield jesseduffield merged commit fa08c6c into jesseduffield:master Sep 13, 2018

4 checks passed

GolangCI No issues found!
Details
ci/circleci: build Your tests passed on CircleCI!
Details
codecov/patch Coverage not affected when comparing eb4b5cd...3cf84a5
Details
codecov/project 91.38% remains the same compared to eb4b5cd
Details

@mingrammer mingrammer deleted the mingrammer:main-error branch Sep 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.