Print better error message on invalid JSON