gouroboros
gouroboros copied to clipboard
Better handling of handshake refusal messages
We are doing unchecked type assertions and accessing array elements without bounds checking. Add better parsing of the 3 different refusal reasons and create specific error types that capture and expose all of the values.
refuseReasonVersionMismatch = [0 , [ * anyVersionNumber ] ]
refuseReasonHandshakeDecodeError = [1 , anyVersionNumber , tstr ]
refuseReasonRefused = [2 , anyVersionNumber , tstr ]