errors.go 917 B

12345678910111213141516
  1. package kafka
  2. import "errors"
  3. // EncodingError is returned from a failure while encoding a Kafka packet. This can happen, for example,
  4. // if you try to encode a string over 2^15 characters in length, since Kafka's encoding rules do not permit that.
  5. var EncodingError = errors.New("kafka: Error while encoding packet.")
  6. // InsufficientData is returned when decoding and the packet is truncated. This can be expected
  7. // when requesting messages, since as an optimization the server is allowed to return a partial message at the end
  8. // of the message set.
  9. var InsufficientData = errors.New("kafka: Insufficient data to decode packet, more bytes expected.")
  10. // DecodingError is returned when there was an error (other than truncated data) decoding the Kafka broker's response.
  11. // This can be a bad CRC or length field, or any other invalid value.
  12. var DecodingError = errors.New("kafka: Error while decoding packet.")