Update error handling.

This commit is contained in:
Jay
2026-04-19 15:21:10 -04:00
parent dfd28d65bc
commit 3066802f62
9 changed files with 119 additions and 43 deletions
+2 -2
View File
@@ -17,8 +17,8 @@ var (
ErrConnectionUnavailable = errors.New("connection unavailable")
)
func NewConfigError(text string) error {
return fmt.Errorf("configuration error: %s", text)
func NewConfigError(err error) error {
return fmt.Errorf("configuration error: %w", err)
}
func NewPoolError(err error) error {
+1 -1
View File
@@ -125,7 +125,7 @@ func TestRunReader(t *testing.T) {
incomingData <- honeybeetest.MockIncomingData{Err: io.EOF}
err := <-conn.Errors()
assert.Equal(t, io.EOF, err)
assert.ErrorIs(t, err, io.EOF)
honeybeetest.Eventually(t, func() bool {
return conn.State() == transport.StateClosed