refactor(contrib/rpc/grpcx): optimize server unary interceptor error …#4785
Open
BandlSkyler wants to merge 1 commit into
Open
refactor(contrib/rpc/grpcx): optimize server unary interceptor error …#4785BandlSkyler wants to merge 1 commit into
BandlSkyler wants to merge 1 commit into
Conversation
af5de0a to
41c782b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 描述
修复:在 UnaryError 拦截器中保留错误详情信息
问题描述
当前
UnaryError拦截器在将自定义错误转换为 gRPC 标准错误时,会丢失扩展错误信息(protobuf 的Details字段)。当错误中包含 Details 扩展信息时(如字段校验失败详情、业务规则违反信息、本地化错误消息等),这些信息会被完全丢弃,导致客户端无法接收到 google.rpc.Status 中定义的丰富错误详情。