Throws an IllegalStateException, but we want an IOException.