Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion trpc/stream/trpc/trpc_client_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,12 @@ RetCode TrpcClientStream::HandleClose(StreamRecvMessage&& msg) {
// Close (RESET) due to an exception, so there is no need to check the stream status.
// Notify the business that the stream has failed.
SetState(State::kClosed);
if (status.OK()) {
// Normally, the reset frame will carry error code. But if it doesn't exist, we add an unknown error.
status.SetFrameworkRetCode(TrpcRetCode::TRPC_STREAM_UNKNOWN_ERR);
status.SetErrorMessage("stream reset recive, but unable to get error message");
}
OnError(status);
std::cout << "stream error occurs" << std::endl;
return RetCode::kError;
}

Expand Down
5 changes: 5 additions & 0 deletions trpc/stream/trpc/trpc_server_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ RetCode TrpcServerStream::HandleClose(StreamRecvMessage&& msg) {
if (reset) {
// When closing (RESET) due to an exception, there is no need to check the stream state.
SetState(State::kClosed);
if (status.OK()) {
// Normally, the reset frame will carry error code. But if it doesn't exist, we add an unknown error.
status.SetFrameworkRetCode(TrpcRetCode::TRPC_STREAM_UNKNOWN_ERR);
status.SetErrorMessage("stream reset recive, but unable to get error message");
}
OnError(status);
return RetCode::kError;
}
Expand Down