-
Notifications
You must be signed in to change notification settings - Fork 0
Re-panic after recovering in Recovery middleware #37
Open
Labels
Description
I think recovering from panics in https://github.com/remind101/pkg/blob/master/httpx/middleware/recovery.go#L41-L51 should be an anti pattern, for a couple reasons:
- In general, it's bad practice to panic in the first place. Normal errors should be returned as an
errortype. - It makes debugging panics in dev really annoying, because you don't get the full stack trace.
I think the recovery middleware still has value, it should recover from the panic, report it to the reporter, then re-panic.
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.