Deal with exceptions when parsing JSON.