calling functions and error messages
Hello
Suppose I have some class member function bool read_config_file(); which returns true if the file was read and false if there was an error.
I've been wondering what would be the best way so that caller could know why the operation failed. One way would be to throw an exception with a proper message (but I dont like to throw exception in this because shouldnt terminate the application) and the next approach I can come up with it would be to return int or enum with error code.
How do you guys solve that kind of problems? Can someone give some examples of what you think its best?
Many thanks!