This isn't quite what I was after for C++, but may work: C++ Exception Class
Predefined I/O Exceptions in Ada
Exception Meaning Status_Error Attempt to read or write to a file that is not open. Mode_Error Attempt to read form an output file or write to an input file. Name_Error Use of an improper file name in an open command. Use_Error Attempt to output on an input device (e.g., the keyboard) Device_Error Hardware malfunction. End_Error Attempt to read past end of file. Data_Error Value read is incompatible with the type of the target variable. Layout_Error Attempt to set column or line number outside its boundary.