aboutsummaryrefslogtreecommitdiff
path: root/website/templates/features
diff options
context:
space:
mode:
Diffstat (limited to 'website/templates/features')
-rw-r--r--website/templates/features/SneakyThrows.html2
1 files changed, 2 insertions, 0 deletions
diff --git a/website/templates/features/SneakyThrows.html b/website/templates/features/SneakyThrows.html
index 5a2d5bbd..5f5c06df 100644
--- a/website/templates/features/SneakyThrows.html
+++ b/website/templates/features/SneakyThrows.html
@@ -14,6 +14,8 @@
</li>
</ul>
</p><p>
+ Being constrained by needlessly strict interfaces is particularly common when using lambda syntax (<code>arg -> action</code>); however, lambdas cannot be annotated, which means it is not so easy to use <code>@SneakyThrows</code> in combination with lambdas.
+ </p><p>
Be aware that it is <em>impossible</em> to catch sneakily thrown checked types directly, as javac will not let you write a catch block for an exception type that no method call in the try body declares as thrown. This problem is not relevant in either of the use cases listed above, so let this serve as a warning that you should not use the <code>@SneakyThrows</code> mechanism without some deliberation!
</p><p>
You can pass any number of exceptions to the <code>@SneakyThrows</code> annotation. If you pass no exceptions, you may throw any exception sneakily.