catch errors around parsing