Key values specified using `With` isn't being shown, when assertion fails
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 990
- Forks
- 45
- Avg merge
- 5d 9h
- Merged PRs (30d)
- 5
Description
err := errors.New("HELLO")
oops.With("error", err).Assertf((err == nil), "Failed connecting to Elasticsearch")
outputs :
panic: Failed connecting to Elasticsearch
goroutine 1 [running]:
github.com/samber/oops.OopsErrorBuilder.Assertf(...)
/tmp/gopath2180193886/pkg/mod/github.com/samber/oops@v1.21.0/builder.go:306
github.com/samber/oops.Assertf(_, {_, _}, {_, _, _})
/tmp/gopath2180193886/pkg/mod/github.com/samber/oops@v1.21.0/oops.go:70 +0x1d8
main.main()
/tmp/sandbox2172285662/prog.go:11 +0x33
Can we have a way, so that key values specified using With also get logged?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with OopsErrorBuilder.Assertf and the oops.Assertf call shown in the example, then trace how values supplied through With are handled when the assertion fails. Done means the failure output includes the key and error value from With("error", err), while preserving the existing assertion message and stack trace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100