MCPcopy Index your code
hub / github.com/foxcpp/maddy / Fields

Function Fields

framework/exterrors/fields.go:46–70  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

44}
45
46func Fields(err error) map[string]interface{} {
47 fields := make(map[string]interface{}, 5)
48
49 for err != nil {
50 errFields, ok := err.(fieldsErr)
51 if ok {
52 for k, v := range errFields.Fields() {
53 // Outer errors override fields of the inner ones.
54 // Not the reverse.
55 if fields[k] != nil {
56 continue
57 }
58 fields[k] = v
59 }
60 }
61
62 unwrap, ok := err.(unwrapper)
63 if !ok {
64 break
65 }
66 err = unwrap.Unwrap()
67 }
68
69 return fields
70}
71
72func WithFields(err error, fields map[string]interface{}) error {
73 return fieldsWrap{err: err, fields: fields}

Callers 7

ErrorMethod · 0.92
DoTestDeliveryNonAtomicFunction · 0.92
DoTestDeliveryErrMetaFunction · 0.92
CheckSMTPErrFunction · 0.92
wrapErrMethod · 0.92
TestDMARCFunction · 0.92
TestDkimVerify_ValidSigFunction · 0.92

Calls 2

FieldsMethod · 0.65
UnwrapMethod · 0.65

Tested by 2

TestDMARCFunction · 0.74
TestDkimVerify_ValidSigFunction · 0.74