Skip to content

Commit

Permalink
kerr: add description to error string
Browse files Browse the repository at this point in the history
  • Loading branch information
twmb committed Jan 5, 2021
1 parent b544d8f commit b68f112
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/kerr/kerr.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// all errors elide the standard "Err" prefix.
package kerr

import "fmt"

// Error is a Kafka error.
type Error struct {
// Message is the string form of a Kafka error code
Expand All @@ -21,7 +23,7 @@ type Error struct {
}

func (e *Error) Error() string {
return e.Message
return fmt.Sprintf("%s: %s", e.Message, e.Description)
}

// ErrorForCode returns the error corresponding to the given error code.
Expand Down

0 comments on commit b68f112

Please sign in to comment.