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

deferred call to os.Exit(exitCode) may hide panics #569

Closed
pashagolub opened this issue May 23, 2023 · 0 comments · Fixed by #570
Closed

deferred call to os.Exit(exitCode) may hide panics #569

pashagolub opened this issue May 23, 2023 · 0 comments · Fixed by #570
Assignees
Labels
🐞 bug Something isn't working ⚡ priority This issue if of high priority, but not critical

Comments

@pashagolub
Copy link
Collaborator

Should be

	defer func() {
		if err := recover(); err != nil {
			exitCode = ExitCodeFatalError
			log.GetLogger(ctx).WithField("callstack", string(debug.Stack())).Error(err)
		}
		os.Exit(exitCode)
	}()
@pashagolub pashagolub self-assigned this May 23, 2023
@pashagolub pashagolub added 🐞 bug Something isn't working ⚡ priority This issue if of high priority, but not critical labels May 23, 2023
@pashagolub pashagolub linked a pull request May 24, 2023 that will close this issue
pashagolub added a commit that referenced this issue May 24, 2023
[-] make sure panics output won't be hidden, fixes #569
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working ⚡ priority This issue if of high priority, but not critical
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant