You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kotlin gRPC exposes a different server endpoint API from Java. It would be useful to have an example of throwing a StatusException, if that's what the Kotlin generated code expects users to do.
The generated RPC functions to override are like this:
/** * Holder for Kotlin coroutine-based client and server APIs for * my_pkg.MyService. */object MyServiceGrpcKt {
...
/** * Returns the response to an RPC for valohealth_monocle.model_search.ModelSearchService.Search. * * If this method fails with a [StatusException], the RPC will fail with the corresponding * [io.grpc.Status]. If this method fails with a [java.util.concurrent.CancellationException], * the RPC will fail * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will * fail with `Status.UNKNOWN` with the exception as a cause. * * @param request The request from the client.*/opensuspendfunsearch(request:ModelSearchRequest): ModelSearchResponse=throwStatusException(UNIMPLEMENTED.withDescription("Method my_pkg.MyService.Search is unimplemented"))
}
So unlike Java, there's no observer to tag errors onto, but the default implementation here seems to give an example of throwing an error.
The text was updated successfully, but these errors were encountered:
Kotlin gRPC exposes a different server endpoint API from Java. It would be useful to have an example of throwing a StatusException, if that's what the Kotlin generated code expects users to do.
With this in
build.gradle
:The generated RPC functions to override are like this:
So unlike Java, there's no
observer
to tag errors onto, but the default implementation here seems to give an example of throwing an error.The text was updated successfully, but these errors were encountered: