error.go 512 B

1234567891011121314151617181920212223
  1. package eventstream
  2. import "fmt"
  3. // LengthError provides the error for items being larger than a maximum length.
  4. type LengthError struct {
  5. Part string
  6. Want int
  7. Have int
  8. Value interface{}
  9. }
  10. func (e LengthError) Error() string {
  11. return fmt.Sprintf("%s length invalid, %d/%d, %v",
  12. e.Part, e.Want, e.Have, e.Value)
  13. }
  14. // ChecksumError provides the error for message checksum invalidation errors.
  15. type ChecksumError struct{}
  16. func (e ChecksumError) Error() string {
  17. return "message checksum mismatch"
  18. }