GRpcExceptionHandler doesn't work [Kotlin]
See original GitHub issueHi, thanks for the work you’ve done. It’s really great starter!
I have some trouble, maybe it related with Kotlin CoroutineImpl. The interceptor below does not catch exception:
@GRpcService
class TempUrlService() : TempUrlServiceGrpcKt.TempUrlServiceCoroutineImplBase() {
private val logger = KotlinLogging.logger {}
@GRpcExceptionHandler
fun anotherHandler(e: NullPointerException, scope: GRpcExceptionScope): Status {
logger.warn { "NPE!" }
return Status.INTERNAL
}
@Throws(Throwable::class)
override suspend fun createThumbnailTempUrl(request: ThumbRequest): ThumbResponse {
throw NullPointerException("HELLO")
}
}
Using 4.5.10 version.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16
Top Results From Across the Web
Cannot catch Exception from Server Stub · Issue #141 - GitHub
I am attempting to install a default Exception handler for our gRPC server stubs. I have tried using both a java gRPC interceptor...
Read more >Micronaut gRPC server endpoint swallows exceptions (other ...
I'm working on a Micronaut gRPC server in Kotlin. By default, if my gRPC endpoint throws an exception, it's swallowed without any logging ......
Read more >Error Handling in gRPC - Baeldung
Learn how to implement error handling in gRPC for unary and stream-based RPC calls.
Read more >Coroutine exceptions handling | Kotlin
CoroutineExceptionHandler is invoked only on uncaught exceptions — exceptions that were not handled in any other way.
Read more >Protocol Buffer Basics: Java - Google Developers
By walking through creating a simple example application, it shows you how to ... 213), and also doesn't work very well if you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I created demo project which reproduces both problems https://github.com/TheHett/grpc_demo/tree/master/src/main/kotlin/com/example/demo/grpc
It should be call manually because I doesn’t know how to write test for this
Any idea @jvmlet please ?