I have several json objects that come from the server. At the moment, I'm using the browsers' json functionalities (my application only supports modern browsers) to parse json to objects.
Should I be using a try/catch to make my app more robust or would using try/catch create another set of problems?
try..catch is not a magical construct to make problems go away. The question is, what would you put in your catch { } clause?
If you can do something useful if the json is broken. Something that allows you to make sure that the state of the app is correct again, then it makes sense.
But, what are the chances you will receive broken json? If you're generating and parsing the json yourself, the chances are low.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With