Java Code Examples for io.grpc.reflection.v1alpha.ErrorResponse

The following examples show how to use io.grpc.reflection.v1alpha.ErrorResponse. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: grpc-nebula-java   Source File: ProtoReflectionService.java    License: Apache License 2.0 5 votes vote down vote up
private void sendErrorResponse(
    ServerReflectionRequest request, Status.Code code, String message) {
  ServerReflectionResponse response =
      ServerReflectionResponse.newBuilder()
          .setValidHost(request.getHost())
          .setOriginalRequest(request)
          .setErrorResponse(
              ErrorResponse.newBuilder()
                  .setErrorCode(code.value())
                  .setErrorMessage(message))
          .build();
  serverCallStreamObserver.onNext(response);
}
 
Example 2
Source Project: quarkus   Source File: ReflectionService.java    License: Apache License 2.0 5 votes vote down vote up
private ServerReflectionResponse getErrorResponse(
        ServerReflectionRequest request, Status.Code code, String message) {
    return ServerReflectionResponse.newBuilder()
            .setValidHost(request.getHost())
            .setOriginalRequest(request)
            .setErrorResponse(
                    ErrorResponse.newBuilder()
                            .setErrorCode(code.value())
                            .setErrorMessage(message))
            .build();

}
 
Example 3
Source Project: grpc-java   Source File: ProtoReflectionService.java    License: Apache License 2.0 5 votes vote down vote up
private void sendErrorResponse(
    ServerReflectionRequest request, Status.Code code, String message) {
  ServerReflectionResponse response =
      ServerReflectionResponse.newBuilder()
          .setValidHost(request.getHost())
          .setOriginalRequest(request)
          .setErrorResponse(
              ErrorResponse.newBuilder()
                  .setErrorCode(code.value())
                  .setErrorMessage(message))
          .build();
  serverCallStreamObserver.onNext(response);
}