diff --git a/rules/S1679/dart/rule.adoc b/rules/S1679/dart/rule.adoc index 5d72a4bc51..335182cfd8 100644 --- a/rules/S1679/dart/rule.adoc +++ b/rules/S1679/dart/rule.adoc @@ -7,8 +7,8 @@ In such case it's recommended to use `rethrow` instead of just `throw`, to prese ---- try { ... -} catch (ex, stacktrace) { - rethrow ex; // preserves the original exception with its stacktrace +} catch (ex) { + rethrow; // preserves the original exception with its stacktrace } ---- @@ -41,11 +41,30 @@ void foo() { methodThrowsException(); } catch (ex) { // ... - rethrow ex; + rethrow; } } ---- == Resources -* https://dart.dev/tools/linter-rules/use_rethrow_when_possible[Dart Lint rule] +* Dart Docs - https://dart.dev/tools/linter-rules/use_rethrow_when_possible[Dart Linter rule - use_rethrow_when_possible] + +ifdef::env-github,rspecator-view[] + +''' +== Implementation Specification +(visible only on this page) + +=== Message + +* Use 'rethrow' to rethrow a caught exception. + +=== Highlighting + +The `throw` statement with the argument. + +''' + +endif::env-github,rspecator-view[] +