PublicAttributes of the error.
()
| 130 | |
| 131 | // PublicAttributes of the error. |
| 132 | func (e *Error) PublicAttributes() map[string]any { |
| 133 | if e == nil { |
| 134 | return nil |
| 135 | } |
| 136 | if len(e.attributes) == 0 { |
| 137 | return nil |
| 138 | } |
| 139 | publicAttributes := make(map[string]any, len(e.attributes)) |
| 140 | nextAttr: |
| 141 | for k, v := range e.attributes { |
| 142 | for _, public := range e.publicAttributes { |
| 143 | if k == public { |
| 144 | publicAttributes[k] = v |
| 145 | continue nextAttr |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | if len(publicAttributes) == 0 { |
| 150 | return nil |
| 151 | } |
| 152 | return publicAttributes |
| 153 | } |
| 154 | |
| 155 | // Attributes are not present in the error definition, so this just returns nil. |
| 156 | func (*Definition) Attributes() map[string]any { return nil } |