Pattern: Missing use of rethrow
Issue: -
As Dart provides rethrow
as a feature, it should be used to improve terseness and readability.
Example of incorrect code:
try {
somethingRisky();
} catch(e) {
if (!canHandle(e)) throw e;
handle(e);
}
Example of correct code:
try {
somethingRisky();
} catch(e) {
if (!canHandle(e)) rethrow;
handle(e);
}