You should raise a proper error class here.  If not IOError, then something else.