Skip to content

Mutate errors at server level (intercepter counterpart) #2485

@Mirko-von-Leipzig

Description

@Mirko-von-Leipzig

I think I'm looking for something like Interceptor except I want to intercept the Response and not the Request.

Essentially I'd like to inspect the gRPC error (if any) and ensure it does not contain sensitive information. As an example, wiping the error message if the code indicates internal error. This would be much easier to do as a tower layer; at the moment we're manually ensuring this is the case in every error variant and mapping, however this isn't possible to properly police or enforce.

We also have internal gRPC services for which we don't want to wipe the error details. However in some cases our public service simply redirects to our internal service and then we have to ensure we wipe the error before proxying the response on.

I though recover_error might do the trick but it appears to be an internal thing?

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