Skip to content

Hide recovered panic message from client #251

@NathanBaulch

Description

@NathanBaulch

What's the recommended way to catch and log panics but not forward them to the client and expose potentially sensitive server information?

The OOTB recovery middleware turns panics into internal errors containing the error text which a logging interceptor further up the stack can log. Unfortunately I can't just add an extra "error obfuscator" middleware because there's no easy way to differentiate between safe internal errors that my code generated versus sensitive internal errors from a recovered panic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions