Skip to content

Fix NotFound errors logged at ERROR when wrapped in multierror#341

Open
sean- wants to merge 1 commit intothought-machine:masterfrom
sean-:fix-grpc-notfound-logging
Open

Fix NotFound errors logged at ERROR when wrapped in multierror#341
sean- wants to merge 1 commit intothought-machine:masterfrom
sean-:fix-grpc-notfound-logging

Conversation

@sean-
Copy link
Copy Markdown

@sean- sean- commented Apr 1, 2026

The gRPC logging interceptors check status.Code(err) to decide whether to log at ERROR or DEBUG. When elan's GetTree handler encounters a NotFound from a child directory lookup, the error is collected via multierror.Group, which wraps it in a *multierror.Error. This loses the gRPC status code (status.Code() returns Unknown) so the interceptor logs at ERROR instead of DEBUG.

Add hasGRPCCode() which uses errors.As to unwrap multierrors (and any other error wrapping) to find the underlying gRPC status code.

The gRPC logging interceptors check status.Code(err) to decide whether
to log at ERROR or DEBUG. When elan's GetTree handler encounters a
NotFound from a child directory lookup, the error is collected via
multierror.Group, which wraps it in a *multierror.Error. This loses
the gRPC status code (status.Code() returns Unknown) so the
interceptor logs at ERROR instead of DEBUG.

Add hasGRPCCode() which uses errors.As to unwrap multierrors (and any
other error wrapping) to find the underlying gRPC status code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant