Catch any Exception not simply an IOException.