Skip to content

Key values specified using With isn't being shown, when assertion fails #114

Description

@Archisman-Mridha
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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions