diff options
author | Luke Shumaker <lukeshu@datawire.io> | 2022-08-15 19:49:46 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@datawire.io> | 2022-08-16 00:05:35 -0600 |
commit | 6476b9ae7019bedd9324786ff47bc25693e01b60 (patch) | |
tree | 3d793bbd40327d20ba7021459862c895cddb5fb2 /errors.go | |
parent | 54bbd1e59317a6e9658eb8098657078cc8e81979 (diff) |
Push nesting-depth checks down in to the parser [ci-skip]
Diffstat (limited to 'errors.go')
-rw-r--r-- | errors.go | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -6,10 +6,21 @@ package lowmemjson import ( "encoding/json" + "errors" "fmt" "reflect" "strings" - "errors" +) + +// parser errors /////////////////////////////////////////////////////////////////////////////////// + +type ParseError struct { + Err error + Offset int64 +} + +var ( + ErrParserExceededMaxDepth = errors.New("exceeded max depth") ) // low-level decode errors ///////////////////////////////////////////////////////////////////////// @@ -65,8 +76,6 @@ func (e *DecodeTypeError) Error() string { func (e *DecodeTypeError) Unwrap() error { return e.Err } -var ErrDecodeExceededMaxDepth = errors.New("exceeded max depth") - // high-level decode errors //////////////////////////////////////////////////////////////////////// // A *DecodeArgumentError is returned from Decode if the argument is |