Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Re-panic after recovering in Recovery middleware #37

Open

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:

  1. In general, it's bad practice to panic in the first place. Normal errors should be returned as an error type.
  2. 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

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /