throw logic_error on bad file open