From 719e0ad4d046d27a65d2c55db3f15a6112c468ca Mon Sep 17 00:00:00 2001 From: Sai Asish Y Date: Tue, 12 May 2026 21:37:38 -0700 Subject: [PATCH] fix(status): map h2 FRAME_SIZE_ERROR to Code::Internal --- tonic/src/status.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tonic/src/status.rs b/tonic/src/status.rs index eeceb32b4..8d6796b20 100644 --- a/tonic/src/status.rs +++ b/tonic/src/status.rs @@ -400,6 +400,7 @@ impl Status { | Some(h2::Reason::INTERNAL_ERROR) | Some(h2::Reason::FLOW_CONTROL_ERROR) | Some(h2::Reason::SETTINGS_TIMEOUT) + | Some(h2::Reason::FRAME_SIZE_ERROR) | Some(h2::Reason::COMPRESSION_ERROR) | Some(h2::Reason::CONNECT_ERROR) => Code::Internal, Some(h2::Reason::REFUSED_STREAM) => Code::Unavailable, @@ -1007,6 +1008,13 @@ mod tests { assert_eq!(source.reason(), Some(h2::Reason::CANCEL)); } + #[test] + #[cfg(feature = "server")] + fn code_from_h2_frame_size_error() { + let err = h2::Error::from(h2::Reason::FRAME_SIZE_ERROR); + assert_eq!(Status::code_from_h2(&err), Code::Internal); + } + #[test] #[cfg(feature = "server")] fn to_h2_error() {