diff --git a/README.adoc b/README.adoc index 7b006ce4..b6f1d28c 100644 --- a/README.adoc +++ b/README.adoc @@ -1968,6 +1968,31 @@ fail SomeException, 'message' raise SomeException, 'message' ---- +=== Reraising exceptions [[reraising-exceptions]] + +Call `raise` without an exception argument when reraising exceptions. + +[source,ruby] +---- +# bad +begin + something_that_might_fail +rescue SomeException => e + # handle SomeException + + raise e +end + +# good +begin + something_that_might_fail +rescue SomeException => e + # handle SomeException + + raise +end +---- + === Raising Explicit `RuntimeError` [[no-explicit-runtimeerror]] Don't specify `RuntimeError` explicitly in the two argument version of `raise`.