fix - log and thrown exception

1. throw IOException avoid infinite loop
2. modify log warning not error