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

server.Start: recover and log panics #10

Merged
merged 5 commits into from
Dec 13, 2018
Merged

server.Start: recover and log panics #10

merged 5 commits into from
Dec 13, 2018

Conversation

bmoylan
Copy link
Contributor

@bmoylan bmoylan commented Dec 12, 2018

This change is Reviewable

@bmoylan bmoylan requested a review from nmiyake December 12, 2018 23:36
Copy link
Contributor

@nmiyake nmiyake left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1.
Reviewable status: 1 of 2 files reviewed, 1 unresolved discussion (waiting on @nmiyake and @bmoylan)


witchcraft/witchcraft.go, line 394 at r1 (raw file):

				rErr = err
			} else {
				rErr = werror.Error("panic recovered", werror.UnsafeParam("recovered", r))

Does this double-wrap? (the svc1log.Error call uses "panic recovered", so do we get "panic recovered" twice in this scenario?)

Also, we should update function documentation to state that all panics are recovered and logged and that, if any panic is encountered, the returned error will be non-nil and be the information on the panic (and only information on the panic -- any other error that was being returned will be overwritten)

@bmoylan
Copy link
Contributor Author

bmoylan commented Dec 13, 2018


witchcraft/witchcraft.go, line 394 at r1 (raw file):

Previously, nmiyake (Nick Miyake) wrote…

Does this double-wrap? (the svc1log.Error call uses "panic recovered", so do we get "panic recovered" twice in this scenario?)

Also, we should update function documentation to state that all panics are recovered and logged and that, if any panic is encountered, the returned error will be non-nil and be the information on the panic (and only information on the panic -- any other error that was being returned will be overwritten)

This one (the error message) will end up in the stacktrace field, while the one below will end up in the message field.

Copy link
Contributor

@nmiyake nmiyake left a comment

Choose a reason for hiding this comment

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

Thanks, :lgtm:

Reviewed 2 of 2 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@nmiyake
Copy link
Contributor

nmiyake commented Dec 13, 2018

(except for the build failing issue :)

@bmoylan bmoylan merged commit 9182059 into develop Dec 13, 2018
@bmoylan bmoylan deleted the bm/panic-recovery branch December 13, 2018 00:54
blakehawkins pushed a commit to blakehawkins/witchcraft-go-server that referenced this pull request Feb 13, 2020
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.

None yet

2 participants