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)
| 91 | // wrapDecodeError creates a DecodeError from a ParserError. The highlight of |
| 92 | // the ParserError needs to be a subslice of the document. |
| 93 | func 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. |
searching dependent graphs…