marianoguerra / json.human.js

Convert JSON to human readable HTML
http://marianoguerra.github.io/json.human.js/
975 stars 79 forks source link

report error.stack to user #13

Closed anaran closed 11 years ago

anaran commented 11 years ago

Hi, this is a neat idea!

Even though this is only a demo, it might still be a good idea to try reporting details to the user.

We know that JSON data can easily become invalid by a missed trailing comma, single-quote instead of double-quotes, etc.

While the reporting is not very detailed in such cases it might still be useful to the user to see something like this:

Error parsing json:
SyntaxError: Unexpected token '
  at Object.parse (native)
  at HTMLButtonElement.doConvert (http://marianoguerra.github.io/json.human.js/js/demo.js:29:25)

when I make a change like that

{
  'name': "json.human",
  "description": "Convert JSON to human readable HTML",
  ...
marianoguerra commented 11 years ago

thanks!