MCPcopy
hub / github.com/pelletier/go-toml / wrapDecodeError

Function wrapDecodeError

errors.go:93–98  ·  view source on GitHub ↗

wrapDecodeError creates a DecodeError from a ParserError. The highlight of the ParserError needs to be a subslice of the document.

(document []byte, de *unstable.ParserError)

Source from the content-addressed store, hash-verified

91// wrapDecodeError creates a DecodeError from a ParserError. The highlight of
92// the ParserError needs to be a subslice of the document.
93func wrapDecodeError(document []byte, de *unstable.ParserError) *DecodeError {
94 if de == nil {
95 return nil
96 }
97 return newDecodeError(document, de.Highlight, de.Key, de.Message)
98}
99
100// newDecodeError creates a DecodeError pointing at the given highlight, which
101// needs to be a subslice of the document.

Callers 4

TestDecodeErrorFunction · 0.85
TestWrapDecodeErrorNilFunction · 0.85
unmarshalMethod · 0.85
wrapErrorMethod · 0.85

Calls 1

newDecodeErrorFunction · 0.85

Tested by 2

TestDecodeErrorFunction · 0.68
TestWrapDecodeErrorNilFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…