Handle i/o errors