Handle JSON parse errors better