Why this matters
Original stack traces are essential for accurate debugging and error grouping.
When re-emitting a caught exception, use `rethrow` instead of `throw e` to keep the original stack trace.
Original stack traces are essential for accurate debugging and error grouping.
Side-by-side examples engineers can pattern-match during review.
catch (e) {
throw e; // resets stack
}catch (e, st) {
logger.severe('operation failed', e, st);
rethrow; // preserves stack
}catch (e) { throw e; }catch (e, st) { rethrow; }From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.