A catch
clause that only rethrows the caught exception has the same effect as omitting the catch
altogether and letting
it bubble up automatically.
try {
saveDocument();
} catch (const std::exception& e) { // Noncompliant
throw;
}
Such clauses should either be removed or populated with the appropriate logic.
saveDocument();
or
try {
saveDocument();
} catch (const std::exception& e) {
log << e.what();
throw;
}