package
0.1.11
Repository: https://github.com/go-modulus/modulus.git
Documentation: pkg.go.dev

# README

errwrap

package main

import (
	"braces.dev/errtrace"
	"context"
	"fmt"
	"github.com/go-modulus/modulus/errlog"
	"github.com/go-modulus/modulus/errwrap"
)

func a() error { return errtrace.Errorf("failed to do a") }

func b() error { return errtrace.Errorf("failed to do b") }

func Pay(_ context.Context, paymentID string) error {
	eb := errwrap.With(
		errlog.With("paymentID", paymentID),
	)
	
	err := a()
	if err != nil {
		return errtrace.Wrap(eb(err))
    }
	return errtrace.Wrap(eb(b()))
}

func main() {
	err := Pay(context.Background(), "aboba")
	fmt.Println(errlog.Meta(err))
}

// Output:
// map[paymentId:aboba]

# Functions

No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author