diff --git a/pkg/mining/errors_test.go b/pkg/mining/errors_test.go index b5a7a1a..0b6ab1a 100644 --- a/pkg/mining/errors_test.go +++ b/pkg/mining/errors_test.go @@ -1,7 +1,6 @@ package mining import ( - "errors" "net/http" "testing" ) @@ -17,14 +16,14 @@ func TestErrors_Error_Good(t *testing.T) { // TestErrors_Error_Bad verifies the error string includes the underlying cause func TestErrors_Error_Bad(t *testing.T) { - cause := errors.New("underlying error") + cause := ErrInternal("underlying error") err := NewMiningError(ErrCodeStartFailed, "failed to start").WithCause(cause) if err.Cause != cause { t.Error("Cause was not set") } - if errors.Unwrap(err) != cause { + if err.Unwrap() != cause { t.Error("Unwrap did not return cause") } } @@ -136,7 +135,7 @@ func TestErrors_PredefinedErrors_Good(t *testing.T) { // TestErrors_Chaining_Ugly verifies error chaining survives multiple WithCause/WithDetails/WithSuggestion calls func TestErrors_Chaining_Ugly(t *testing.T) { - cause := errors.New("network timeout") + cause := ErrTimeout("network timeout") err := ErrConnectionFailed("pool:3333"). WithCause(cause). WithDetails("timeout after 30s").