@@ -62,23 +62,20 @@ impl Reason {
6262 /// Get a string description of the error code.
6363 pub fn description ( & self ) -> & str {
6464 match self . 0 {
65- 0 => "not a result of an error" ,
66- 1 => "unspecific protocol error detected" ,
67- 2 => "unexpected internal error encountered" ,
68- 3 => "flow-control protocol violated" ,
69- 4 => "settings ACK not received in timely manner" ,
70- 5 => "received frame when stream half-closed" ,
71- 6 => "frame with invalid size" ,
72- 7 => "refused stream before processing any application logic" ,
73- 8 => "stream no longer needed" ,
74- 9 => "unable to maintain the header compression context" ,
75- 10 => {
76- "connection established in response to a CONNECT request was reset or abnormally \
77- closed"
78- }
79- 11 => "detected excessive load generating behavior" ,
80- 12 => "security properties do not meet minimum requirements" ,
81- 13 => "endpoint requires HTTP/1.1" ,
65+ 0 => "graceful shutdown" ,
66+ 1 => "protocol error detected" ,
67+ 2 => "implementation fault" ,
68+ 3 => "flow-control limits exceeded" ,
69+ 4 => "settings not acknowledged" ,
70+ 5 => "frame received for closed stream" ,
71+ 6 => "frame size incorrect" ,
72+ 7 => "stream not processed" ,
73+ 8 => "stream cancelled" ,
74+ 9 => "compression state not updated" ,
75+ 10 => "TCP connection error for CONNECT method" ,
76+ 11 => "processing capacity exceeded" ,
77+ 12 => "negotiated TLS parameters not acceptable" ,
78+ 13 => "use HTTP/1.1 for the request" ,
8279 _ => "unknown reason" ,
8380 }
8481 }
@@ -129,6 +126,9 @@ impl fmt::Debug for Hex {
129126
130127impl fmt:: Display for Reason {
131128 fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
132- write ! ( fmt, "{}" , self . description( ) )
129+ match self . 0 {
130+ 0 ..=13 => write ! ( fmt, "{}" , self . description( ) ) ,
131+ _ => write ! ( fmt, "unknown error code {}" , self . 0 ) ,
132+ }
133133 }
134134}
0 commit comments