lbryio / lbry.go

MIT License
29 stars 20 forks source link

Wrapped errors appear as robot vomit in test failure messages #62

Closed anbsky closed 4 years ago

anbsky commented 5 years ago

When assertions like assert.Nil(t, err) for extras.errors.Err fail in tests, this is the output I'm getting:

            Error Trace:    lbrynet_test.go:75
            Error:          Expected nil, but got: &errors.Error{Err:(*errors.errorString)(0xc0000b06a0), stack:[]uintptr{0x1511f5b, 0x151293a, 0x10fd080, 0x105da11}, frames:[]errors.StackFrame(nil), prefix:""}

In contrast, this is the output for the standard errors.New object in the same spot:

            Error Trace:    lbrynet_test.go:75
            Error:          Expected nil, but got: &errors.errorString{s:"empty structure from sdk client"}
lyoshenka commented 4 years ago

solution: use assert.NoError(t, err) instead