michalmuskala / jason

A blazing fast JSON parser and generator in pure Elixir.
Other
1.58k stars 168 forks source link

Better error messaging on invalid escapes #159

Open colman-hartinger opened 1 year ago

colman-hartinger commented 1 year ago

Enhancement

example bad escape: "{\"foo\":\"bar\\'s \"}"

Jason error message:

{:error,
 %Jason.DecodeError{
   data: "{\"foo\":\"bar\\'s  \"}",
   position: 12,
   token: nil
 }}

Python error message: json.decoder.JSONDecodeError: Invalid \escape: line 1 column 12 (char 11)