When exceptions occur, it is usually a bad idea to simply ignore them. Instead, it is better to handle them properly, or at least to log them.
Noncompliant code example
void save() {
try {
saveDocument();
} catch (exception) {
}
}
Compliant solution
void save() {
try {
saveDocument();
} catch (exception) {
log(exception);
}
}
void save() {
try {
saveDocument();
} catch (_) { // Compliant, ignored intentionally
}
}
void save() {
try {
saveDocument();
} catch (exception) { // Compliant, left a comment
// ignored intentionally
}
}