Writing a wrapper with my own exceptions
I want to make a FileIO class which will provide some methods like write or read. Also I want to hide the implementation of FileIO (currently, it just derives from std::fstream). The problem is that std::fstream could throw some exceptions but I don't want my FileIO class to throw std::fstream exceptions, I want to throw my own (e.g. FileIO::SomethingBadHappened). Is there an elegant way to do this?

**My solution** is to just rewrite every method of std::fstream with an additional try/catch block.
Writing a wrapper with my own exceptions
===

I want to make a FileIO class which will provide some methods like write or read. Also I want to hide the implementation of FileIO (currently, it just derives from std::fstream). The problem is that std::fstream could throw some exceptions but I don't want my FileIO class to throw std::fstream exceptions, I want to throw my own (e.g. FileIO::SomethingBadHappened). Is there an elegant way to do this?

**My solution** is to just rewrite every method of std::fstream with an additional try/catch block.