A catch
clause that only rethrows the caught exception has the same effect as omitting the catch
altogether and letting
it bubble up automatically.
do {
try loadImage(imagePath)
} catch { // Noncompliant
throw error
}
Such clauses should either be removed or populated with the appropriate logic.
try loadImage(imagePath)
or
do {
try loadImage(imagePath)
} catch {
handleImageError(error)
throw error
}