(f xerrors.Formatter)
| 146 | } |
| 147 | |
| 148 | func errorChain(f xerrors.Formatter) []interface{} { |
| 149 | var errs []interface{} |
| 150 | |
| 151 | next := error(f) |
| 152 | for { |
| 153 | f, ok := next.(xerrors.Formatter) |
| 154 | if !ok { |
| 155 | errs = append(errs, next) |
| 156 | return errs |
| 157 | } |
| 158 | |
| 159 | p := &xerrorPrinter{} |
| 160 | next = f.FormatError(p) |
| 161 | errs = append(errs, p.e) |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | type wrapError struct { |
| 166 | Msg string `json:"msg"` |