kgo: export the wrapped error from ErrGroupSession
We want to test in a unit test the behaviour exposed in this question: https://github.com/twmb/franz-go/issues/784, where we rely on this error type. So we need to create this kind of error, with another wrapped one inside it in the tests.
Would this change be ok? The only side efect of it is that clients of the lib would be able to create it too.
Why not use Unwrap to get the inner error, rather than exposing the error?
Why not use
Unwrapto get the inner error, rather than exposing the error?
Our problem is that we want to create this error ourselves, in the test, to simulate a kgo.Fetches that contains this error. Something like:
egs := kgo.ErrGroupSession{Err: syscall.ECONNREFUSED}
fetch := kgo.Fetch{
Topics: []kgo.FetchTopic{{
Topic: "dummyTopic",
Partitions: []kgo.FetchPartition{{
Partition: 0,
Err: err,
}},
}}}
We currently can not do it, as the err is not exported in kgo.ErrGroupSession.
Hey @twmb! Just a friendly reminder of the existence of this PR. Thanks!
I haven't forgotten -- I'm primarily waiting until this weekend or next (or next) to set aside time to implement the three new KIPs that were released in Kafka 3.8.
That said -- I'm still not sure what value a test on this particular error provides? Stakes here are pretty low though, so I'm not really opposed either.
I'm still not sure what value a test on this particular error provides?
For us, it allows to unit test the exact scenario described in the question https://github.com/twmb/franz-go/issues/784 , that we're not exiting the poll loop when we get such an error.
Bit of a delay on my side... releasing this evening.