Skip to content

Commit a858523

Browse files
committed
export and use handler.WrapError
1 parent fa9e3e8 commit a858523

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/handler/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const (
6666
// sentinel error info and we couldn't use annotation for this error.
6767
// However, we should think about this more later from performance point of
6868
// view.
69-
wrapError = ": %w"
69+
WrapError = ": %w"
7070
)
7171

7272
func PanicNoop(any) {}
@@ -226,7 +226,7 @@ func (i *Info) safeErr() error {
226226
// wrapStr returns always wrap string that means we are using "%w" to chain
227227
// errors to be able to use errors.Is and errors.As functions form Go stl.
228228
func (i *Info) wrapStr() string {
229-
return wrapError
229+
return WrapError
230230
}
231231

232232
// WorkToDo returns if there is something to process. This is offered for

try/out.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func Out2[T any, U any](v1 T, v2 U, err error) *Result2[T, U] {
268268
}
269269

270270
func wrapStr() string {
271-
return ": %w"
271+
return handler.WrapError
272272
}
273273

274274
func (o *Result) logf(lvl int, a []any) *Result {

0 commit comments

Comments
 (0)