json: improve 'bad input' error message (#2420)
When 'read-json' finds "bad input", print the input to try to show what went wrong.
This commit is contained in:
parent
a66038a427
commit
0c2ada98ff
|
@ -248,7 +248,7 @@
|
|||
(cond [(equal? m #"\"") (read-string)]
|
||||
[(equal? m #"[") (read-list 'array #rx#"^\\]" read-json)]
|
||||
[(equal? m #"{") (read-hash)])))]
|
||||
[else (err "bad input")]))
|
||||
[else (err (format "bad input~n ~e" (peek-bytes (sub1 (error-print-width)) 0 i)))]))
|
||||
;;
|
||||
(read-json #t))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user