While reading a PR, I notice the codebase is incon...
# core
s
While reading a PR, I notice the codebase is inconsistent in how it handles errors reading a file. Sometimes we early return:
Copy code
std::string contents;
  if (!forensicReadFile(filename, contents).ok()) {
    TLOG << "couldn't read sudoers file: " << filename;
    return;
  }
Other times we nest the if:
Copy code
if (forensicReadFile(history_file, history_content).ok()) {
...
}
I think the early return is more common. But I wanted to poll folk here for idiom