7.7.      C++ 263

     .   -
   ,    .  -
 ,     ,    -
  , ""   logic_error 
runtime_error.      runtime_error  -
,   ""  .  runtime_error  -
  exception.      
 .  :

class ?ile_access_exception : public runtime_error{
protected:

//. ..

int ErrorNumber;

string DetailedExplanation;

string FileName;

//. . .
public:

virtual int takeCorrectiveAction(void)

string detailedExplanation(void) ;

//. . .
};

  file_access_exception   runtime_error  
       -.  -
,   takeCorrectiveAction ().    -
    ,     -
          -
 .   ?ile_access_exception "", 
     .  ,  
 ,     ,  
 ,        -
   .     
file_access_exception    ,   -
 ,    C++.  .

try{

//...

fileProcessingOperation() ;

//. . .
}

catch(file_access_exception &E)
{

cerr  E.whatO  endl;

cerr  E.detailedExplanation()  endl;

E.takeCorrectiveAction() ;

//    

//   .

//. . .
}

      ExceptionTable, 
  ErrorTable   7.1  7.2.    
        -
 .