You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// SilentWrap provides a simple wrapper for a wrapped error where the wrapped error message plays no part in the error message
25
+
// errorWrapper provides a simple wrapper for a wrapped error where the wrapped error message plays no part in the error message
26
26
// Especially useful for "untyped" errors created with "errors.New(…)" that can be classified as 'invalid argument', 'permission denied', 'exists already', or 'does not exist'
27
-
typeSilentWrapstruct {
27
+
typeerrorWrapperstruct {
28
28
Messagestring
29
29
Errerror
30
30
}
31
31
32
32
// Error returns the message
33
-
func (wSilentWrap) Error() string {
33
+
func (werrorWrapper) Error() string {
34
34
returnw.Message
35
35
}
36
36
37
37
// Unwrap returns the underlying error
38
-
func (wSilentWrap) Unwrap() error {
38
+
func (werrorWrapper) Unwrap() error {
39
39
returnw.Err
40
40
}
41
41
42
-
typeLocaleWrapstruct {
42
+
typeLocaleWrapperstruct {
43
43
errerror
44
44
TrKeystring
45
45
TrArgs []any
46
46
}
47
47
48
48
// Error returns the message
49
-
func (wLocaleWrap) Error() string {
49
+
func (wLocaleWrapper) Error() string {
50
50
returnw.err.Error()
51
51
}
52
52
53
53
// Unwrap returns the underlying error
54
-
func (wLocaleWrap) Unwrap() error {
54
+
func (wLocaleWrapper) Unwrap() error {
55
55
returnw.err
56
56
}
57
57
58
-
// NewSilentWrapErrorf returns an error that formats as the given text but unwraps as the provided error
0 commit comments