You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.
I've just spent part of my evening reading the source code. I notice in server.go that error is returned in some cases, while panic(...) is called in other error cases. Here's an example.
The convention in the Go libraries is that even when a package uses panic internally, its external API still presents explicit error return values.
My question is, is there a specific reason as to why the raft library uses panic(...) as opposed to errors? Does it distinguish between the two somehow?
The text was updated successfully, but these errors were encountered:
@JensRantil Some of the panics are for unrecoverable errors. We should use errors instead most of the time. The ones in command.go are there because they shouldn't fail but if they do then it'll typically happen at initialization. As Xiang said, feel free to send a PR. Otherwise we can try to tackle it in the near future.
I've just spent part of my evening reading the source code. I notice in server.go that
error
is returned in some cases, whilepanic(...)
is called in other error cases. Here's an example.A Go blog article states
My question is, is there a specific reason as to why the raft library uses
panic(...)
as opposed to errors? Does it distinguish between the two somehow?The text was updated successfully, but these errors were encountered: