I know this is subjective, but should exceptions be caught in the lowest level or higher. I ask because I usually do
try
{
//..
}
catch
{
//LOG
}
So when I implement some "low level" function, like
std::string read_from_file(const std::string& file_name);
Im not sure what should I do:
1) let caller handle exception.
2) catch (log?) and rethrow
3) catch and change function so that bool is return type(last line in try is return true; last line in catch is return false;). I dont like this but Ive seen it done many times.
4) ???