v5.7.0: Better panic handling
This release includes two changes to make panics easier to handle in Twirp servers, as well as a minor bug fix to correct #171.
First, panics are now propagated to Error hooks, allowing application owners to add instrumentation around them. Panics will be wrapped with as twirp.Error
s, but will support a Cause() error
method, so you can use github.com/pkg/errors to retrieve the root cause of errors in hooks. This was implemented in #160.
Second, Twirp servers now flush error responses when panicking, so that clients always get the message, and don't see a broken pipe if the server crashes due to the panic. In addition, Twirp servers now set Content-Length on all responses, so clients can be sure they have received the complete message. This was implemented in #168.
Finally, protoc-gen-twirp
now generated correct code for service definitions with no methods. This was implemented in #171.