gfe-relnote: In QUIC, ensure STREAM frames are never sent at level ENCRYPTION_HANDSHAKE. Not protected as ENCRYPTION_HANDSHAKE is not used currently.

PiperOrigin-RevId: 246498127
Change-Id: Ib558b86f56965d94a456cc1b38176924eeaf3136
diff --git a/quic/core/quic_packet_creator.cc b/quic/core/quic_packet_creator.cc
index 548b504..4934666 100644
--- a/quic/core/quic_packet_creator.cc
+++ b/quic/core/quic_packet_creator.cc
@@ -841,9 +841,11 @@
   if (frame.type == STREAM_FRAME &&
       frame.stream_frame.stream_id !=
           QuicUtils::GetCryptoStreamId(framer_->transport_version()) &&
-      packet_.encryption_level == ENCRYPTION_INITIAL) {
-    const std::string error_details =
-        "Cannot send stream data without encryption.";
+      (packet_.encryption_level == ENCRYPTION_INITIAL ||
+       packet_.encryption_level == ENCRYPTION_HANDSHAKE)) {
+    const std::string error_details = QuicStrCat(
+        "Cannot send stream data with level: ",
+        QuicUtils::EncryptionLevelToString(packet_.encryption_level));
     QUIC_BUG << error_details;
     delegate_->OnUnrecoverableError(
         QUIC_ATTEMPT_TO_SEND_UNENCRYPTED_STREAM_DATA, error_details,