test handling error