Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The error is not accurately describe #28

Closed
njspok opened this issue Jun 7, 2019 · 3 comments · Fixed by #29
Closed

The error is not accurately describe #28

njspok opened this issue Jun 7, 2019 · 3 comments · Fixed by #29

Comments

@njspok
Copy link

njspok commented Jun 7, 2019

Very nice library! But there is one drawback.

Run this test

package baloo

import (
	"gopkg.in/h2non/baloo.v3"
	"testing"
)

func Test(t *testing.T) {
	b := baloo.New("http://www.ya.ru")
	_ = b.Get(".").Expect(t).Status(11).Done()
	_ = b.Get(".").Expect(t).Status(11).Done()
	_ = b.Get(".").Expect(t).Status(11).Done()
}

Look result

=== RUN   Test
--- FAIL: Test (0.35s)
    expect.go:204: Unexpected status code: 404 != 11
    expect.go:204: Unexpected status code: 404 != 11
    expect.go:204: Unexpected status code: 404 != 11
FAIL

Process finished with exit code 1

There is no way to know exactly where the test failed. The error message point inside the library

@zak905
Copy link
Contributor

zak905 commented Jan 10, 2022

I confirm, this is annoying, is there any way to fix this ?

@zak905
Copy link
Contributor

zak905 commented May 19, 2022

Hello any updates about this ? not sure but maybe using debug.Stack() https://pkg.go.dev/runtime/debug#Stack could help extracting those info

@zak905
Copy link
Contributor

zak905 commented Aug 4, 2022

I just submitted a fix #29

@h2non h2non closed this as completed in #29 Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants