summaryrefslogtreecommitdiff
path: root/vendor/github.com/bytedance/sonic/ast/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/bytedance/sonic/ast/error.go')
-rw-r--r--vendor/github.com/bytedance/sonic/ast/error.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/vendor/github.com/bytedance/sonic/ast/error.go b/vendor/github.com/bytedance/sonic/ast/error.go
index 00a04468e..3716e7a91 100644
--- a/vendor/github.com/bytedance/sonic/ast/error.go
+++ b/vendor/github.com/bytedance/sonic/ast/error.go
@@ -17,6 +17,10 @@ func newError(err types.ParsingError, msg string) *Node {
}
}
+func newErrorPair(err SyntaxError) *Pair {
+ return &Pair{0, "", *newSyntaxError(err)}
+}
+
// Error returns error message if the node is invalid
func (self Node) Error() string {
if self.t != V_ERROR {
@@ -79,7 +83,7 @@ func (self SyntaxError) description() string {
/* check for empty source */
if self.Src == "" {
- return fmt.Sprintf("no sources available: %#v", self)
+ return fmt.Sprintf("no sources available, the input json is empty: %#v", self)
}
/* prevent slicing before the beginning */