mediamonks / muban

A backend-agnostic framework to enhance server-rendered HTML using a modern webpack development setup.
https://mediamonks.github.io/muban/
39 stars 15 forks source link

Docs show how to parse json but fall short on notifying about using try/catch #156

Open skulptur opened 4 years ago

skulptur commented 4 years ago

If the data is incorrect, JSON.parse will throw. At the very least I think it should be mentioned in the docs that it is important/good practice to try/catch. Ideally there would be a built in helper that throws a descriptive error by default.

https://github.com/mediamonks/muban/blob/master/docs/13-guides.md#get-data-from-embedded-json