You are already using them. FileHandler::input, FileHandler::addToOutputContainer, FileHandler::copyInputToOutput can throw std::bad_alloc, and FileHandler::next can throw std::out_of_range.
Since your constructor doesn't do anything meaningful and there is no invariant I can see, there is no reason to throw your own. Well, since you're calling fstream::close directly (why?), you could pretend your invariant is that both member streams are closed (why are they members?) and throw if close fails.
You are already using them. FileHandler::input, FileHandler::addToOutputContainer, FileHandler::copyInputToOutput can throw std::bad_alloc, and FileHandler::next can throw std::out_of_range.
Wow thats really helped. I thought I should do it for every single line of code my self. Thanks stl and thanks cubbi
You are confused about this because you are the person designing the class and you are the person using it. Exceptions doesn't make sense here. Use error codes. Exceptions are more useful when your are using someone else's code and you want at least well defined exit if his/her code encounters something nasty (exceptions).
If you are using that for the sake of learning, think how you might help convey the problem if anything happens, to your code user. And then design your exceptions around that concept.
When designing a class, I find it helpful to think that the methods should not "do the work." Instead they should "make doing the work easy." If you think this way, you'll end up with a much more flexible class. Consider for example:
What if I want to write some stuff to a file, then write your class to the file, then write some more stuff myself? Right now I'd have to write my data, close the file, tell your class to append, then open the file again in append mode, then continue writing. Yuck.
What if I have already read the file into a string and want to use your class to process the contents of the string? I have to write the string to a file and then use your class.
To avoid these problems, the class should be a StreamHandler instead of a FileHandler. Anywhere you have a file stream, it should just be a stream instead. Don't open/close the streams in the class - let the caller do that.