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

starlark,resolve,internal/compile: replace log.Fatal with panic #235

Merged
merged 1 commit into from
Aug 19, 2019

Conversation

aarzilli
Copy link
Contributor

I've replaced some calls to log.Fatal and log.Fatalf with panics. I believe those are all unreachable internal errors (in practice) so this is a somewhat inconsequential nitpick; however if this code were ever to execute, I believe a recoverable panic, carrying stacktrace information is preferrable to getting the calling process instantly killed.

Copy link
Contributor

@alandonovan alandonovan left a comment

Choose a reason for hiding this comment

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

Let's use log.Panicf then.

@aarzilli
Copy link
Contributor Author

Done.

@alandonovan
Copy link
Contributor

Sorry, do you mind changing the CL description to say "so that we get a stack"? I don't agree that a library shouldn't kill its process. I think it's the correct way to handle unrecoverable errors.

Replace calls to log.Fatal/log.Fatalf with log.Panicf calls so that we
get a stacktrace.
@aarzilli
Copy link
Contributor Author

Done.

@alandonovan alandonovan merged commit 688506e into google:master Aug 19, 2019
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.

2 participants