MCPcopy Create free account
hub / github.com/blues/note / addErrorContext

Method addErrorContext

jsonxt/decode.go:304–314  ·  view source on GitHub ↗

addErrorContext returns a new error enhanced with information from d.errorContext

(err error)

Source from the content-addressed store, hash-verified

302
303// addErrorContext returns a new error enhanced with information from d.errorContext
304func (d *decodeState) addErrorContext(err error) error {
305 if d.errorContext.Struct != nil || d.errorContext.Field != "" {
306 switch err := err.(type) {
307 case *UnmarshalTypeError:
308 err.Struct = d.errorContext.Struct.Name()
309 err.Field = d.errorContext.Field
310 return err
311 }
312 }
313 return err
314}
315
316// skip scans to the end of what was started.
317func (d *decodeState) skip() {

Callers 2

unmarshalMethod · 0.95
saveErrorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected