grpc-ecosystem / grpc-ecosystem/grpc-spring

请问异常处理能否提供demo

Open
#799 2 comments 0 reactions 0 assignees View on GitHub
enhancement examples question
Dominant language
Java
Stars
3.7k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

**The context**

1. 请问异常处理的地方能否出一个demo。我服务端发的metadata,客户端总是接不到
2. 异常处理时返回了Status,StatusRuntimeException、StatusException。可是客户端收到的都是StatusRuntimeException是否正常?
3. 能否出一个教程去改造GrpcExceptionHandler?因为Spring的ExceptionHandler在捕获异常后可以处理成正常消息返回。我觉得大家还是很需要这种功能的。毕竟Grpc的异常处理能力确实不行。

**The question**

1. 请问异常处理的地方能否出一个demo。我服务端发的metadata,客户端总是接不到
2. 异常处理时返回了Status,StatusRuntimeException、StatusException。可是客户端收到的都是StatusRuntimeException是否正常?
3. 能否出一个教程去改造GrpcExceptionHandler?因为Spring的ExceptionHandler在捕获异常后可以处理成正常消息返回。我觉得大家还是很需要这种功能的。毕竟Grpc的异常处理能力确实不行。

**Stacktraces and logs**

**The application's environment**

Which versions do you use?
* Spring (boot): 3.0.0
* grpc-java: 1.51.0
* protobuf: 3.21.9
* grpc-spring-boot-starter: 2.13.1.RELEASE
* protobuf-plugin: 0.6.1
* java: OpenJDK 18.0.2.1 64-Bit Zulu18.32+13-CA

**Additional information**

* Did it ever work before? 不行
* How can we reproduce it? 看demo
* Do you have a demo? 请看网址https://jidaojiuyou.lanzout.com/ipjQ70htu1qj

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the external demo linked in the issue alongside the stated Spring Boot, grpc-java, protobuf, and starter versions. Reproduce the metadata delivery and exception-type behavior, then document the observed handling and any GrpcExceptionHandler customization steps. Done means a clear demo or tutorial covers the requested cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, java, spring-boot
Domain
api, backend, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.