call handler_error on input output error

close #616