servicetalk-grpc-netty/src/main/java/io/servicetalk/grpc/netty/GrpcUtils.java
// and is also used in the api module as that would lead to circular dependency.
and is also used in the api module as that would lead to circular dependency.
and is also used in the api module as that would lead to circular dependency .
static GrpcStatus toGrpcStatus(Throwable cause) {
        final GrpcStatus status;
        if (cause instanceof Http2Exception) {
            Http2Exception h2Exception = (Http2Exception) cause;
            status = new GrpcStatus(fromHttp2ErrorCode(h2Exception.errorCode()), cause);
        } else if (cause instanceof MessageEncodingException) {
            MessageEncodingException msgEncException = (MessageEncodingException) cause;
            status = new GrpcStatus(UNIMPLEMENTED, cause, "Message encoding '" + msgEncException.encoding()
                    + "' not supported ");
        } else if (cause instanceof SerializationException) {
            status = new GrpcStatus(UNKNOWN, cause, "Serialization error: " + cause.getMessage());
        } else if (cause instanceof CancellationException) {
            status = new GrpcStatus(CANCELLED, cause);
        } else if (cause instanceof TimeoutException) {
            status = new GrpcStatus(DEADLINE_EXCEEDED, cause);
        } else {
            status = new GrpcStatus(UNKNOWN, cause, cause.toString());
        }
        return status;
    }
static GrpcStatus toGrpcStatus ( Throwable cause ) { final GrpcStatus status ; if ( cause instanceof Http2Exception ) { Http2Exception h2Exception = ( Http2Exception ) cause ; status = new GrpcStatus ( fromHttp2ErrorCode ( h2Exception . errorCode ( ) ) , cause ) ; } else if ( cause instanceof MessageEncodingException ) { MessageEncodingException msgEncException = ( MessageEncodingException ) cause ; status = new GrpcStatus ( UNIMPLEMENTED , cause , "Message encoding '" + msgEncException . encoding ( ) + "' not supported " ) ; } else if ( cause instanceof SerializationException ) { status = new GrpcStatus ( UNKNOWN , cause , "Serialization error: " + cause . getMessage ( ) ) ; } else if ( cause instanceof CancellationException ) { status = new GrpcStatus ( CANCELLED , cause ) ; } else if ( cause instanceof TimeoutException ) { status = new GrpcStatus ( DEADLINE_EXCEEDED , cause ) ; } else { status = new GrpcStatus ( UNKNOWN , cause , cause . toString ( ) ) ; } return status ; }
and is also used in the api module as that would lead to circular dependency.
and is also used in the api module as that would lead to circular dependency .
// Initialize detail because cause is often lost