separated parser error handling from public parser interface