Make the code below able to handle if the response we get in json is not valid JSON.
<pre>
- If it’s not a valid JSON, or it doesn’t contain the zip code:
Log “invalid json” and don’t call logZip.
- Valid JSON with the zip code:
Call logZip.
- In any case:
Don’t let an unhandled exception escape the promise chain.
</pre>
Check the console for the results.