Prevent QUIC streams from closing the connection directly.

Instead the error is passed through a delegate to the QUIC session to handle.

gfe-relnote: no behavior change. not protected.
PiperOrigin-RevId: 294729094
Change-Id: I4f0fc7b4ddbcd34ddf549ae4d053cbcc78535987
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc
index ebd0380..a85ab2d 100644
--- a/quic/core/quic_session.cc
+++ b/quic/core/quic_session.cc
@@ -839,6 +839,13 @@
       ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
 }
 
+void QuicSession::OnStreamError(QuicErrorCode error_code,
+                                std::string error_details) {
+  connection_->CloseConnection(
+      error_code, error_details,
+      ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
+}
+
 void QuicSession::SendMaxStreams(QuicStreamCount stream_count,
                                  bool unidirectional) {
   control_frame_manager_.WriteOrBufferMaxStreams(stream_count, unidirectional);