feat(pgproto3): expose MaxExpectedBodyLen and ActualBodyLen in ExceededMaxBodyLenErr struct

pull/1875/head
jeremy.spriet 2024-01-03 11:50:45 +01:00 committed by Jack Christensen
parent f654d61d79
commit 1fdd17041a
1 changed files with 3 additions and 3 deletions

View File

@ -71,12 +71,12 @@ func (e *writeError) Unwrap() error {
} }
type ExceededMaxBodyLenErr struct { type ExceededMaxBodyLenErr struct {
maxExpectedBodyLen int MaxExpectedBodyLen int
actualBodyLen int ActualBodyLen int
} }
func (e *ExceededMaxBodyLenErr) Error() string { func (e *ExceededMaxBodyLenErr) Error() string {
return fmt.Sprintf("invalid body length: expected at most %d, but got %d", e.maxExpectedBodyLen, e.actualBodyLen) return fmt.Sprintf("invalid body length: expected at most %d, but got %d", e.MaxExpectedBodyLen, e.ActualBodyLen)
} }
// getValueFromJSON gets the value from a protocol message representation in JSON. // getValueFromJSON gets the value from a protocol message representation in JSON.