Skip to content

Commit a7b641f

Browse files
authored
[3.3] Optimize TriRpcStatus by adding http status code to its description (#15708)
* Optimize TriRpcStatus by adding http status code to its description * Fix dubboCodeToTriCode method by converting METHOD_NOT_FOUND to UNIMPLEMENTED * Add back invalid keyword to TriRpcStatus description at validateHeaderStatus method
1 parent 2170f0f commit a7b641f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/TriRpcStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public static Code dubboCodeToTriCode(int rpcExceptionCode) {
135135
code = Code.UNAVAILABLE;
136136
break;
137137
case METHOD_NOT_FOUND:
138-
code = Code.NOT_FOUND;
138+
code = Code.UNIMPLEMENTED;
139139
break;
140140
case SERIALIZATION_EXCEPTION:
141141
code = Code.INTERNAL;

dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/AbstractTripleClientStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ private TriRpcStatus validateHeaderStatus(Http2Headers headers) {
244244
final CharSequence contentType = headers.get(HttpHeaderNames.CONTENT_TYPE.getKey());
245245
if (contentType == null || !GrpcUtils.isGrpcRequest(contentType.toString())) {
246246
return TriRpcStatus.fromCode(TriRpcStatus.httpStatusToGrpcCode(httpStatus))
247-
.withDescription("invalid content-type: " + contentType);
247+
.withDescription("HTTP status: " + httpStatus + ", invalid content-type: " + contentType);
248248
}
249249
return null;
250250
}

0 commit comments

Comments
 (0)