package zen import ( "fmt" "time" "gitlab.bareksa.com/backend/zen/core/zcaller" "gitlab.bareksa.com/backend/zen/core/zerr" "gitlab.bareksa.com/backend/zen/core/zlog" "gitlab.bareksa.com/backend/zen/core/znotify" ) func Wrap(err error, message string) zerr.Error { input := zerr.WrapInput{ Errors: []error{err}, Message: message, PC: zcaller.Get(3), Time: time.Now(), Logger: zlog.Logger, Notifier: zerr.NullNotifier{}, Details: []any{}, } return zerr.Wrap(input) } func Wrapf(err error, message string, args ...any) zerr.Error { input := zerr.WrapInput{ Errors: []error{err}, Message: fmt.Sprintf(message, args...), PC: zcaller.Get(3), Time: time.Now(), Logger: zlog.Logger, Notifier: znotify.DefaultNotifier, Details: []any{}, } return zerr.Wrap(input) } func Wrapw(err error, message string, fields ...any) zerr.Error { input := zerr.WrapInput{ Errors: []error{err}, Message: message, PC: zcaller.Get(3), Time: time.Now(), Logger: zlog.Logger, Notifier: znotify.DefaultNotifier, Details: fields, } return zerr.Wrap(input) }