handle errors in sax parsing