gunli commented on issue #1142: URL: https://github.com/apache/pulsar-client-go/issues/1142#issuecomment-1863783926
> Thank you for your report, when you want to check if the error comes from the server or client, it isn't easy, and the error has been wrapped by `fmt.Errorf()`, we cannot find the original error from the wrapped error. > > > The better way is to sort out errors relative producer/consumer public API. > > This is a good direction, and we can define a const error instead of the current implementation, and wrapping the original error by `errors.Join()` which is introduced by Go 1.20. > > For the library, we need to be compatible with lower versions of Go, so we need to consider introducing an error-wrap library instead `errors.Join()`, and it needs to be compatible with `errors.Is()` of Go 1.20 to check the original error. > > The following are known error-wrap libraries: > > * https://github.com/cockroachdb/errors > * https://github.com/hashicorp/go-multierror > * https://github.com/uber-go/multierr I have checked these packages, "https://github.com/cockroachdb/errors" require go 1.19, "https://github.com/uber-go/multierr" require go 1.20, may be we can use "https://github.com/hashicorp/go-multierror" -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
