From cf1f8980baa5244aa85f59d688099ff15236c6fb Mon Sep 17 00:00:00 2001 From: Denys Kurets Date: Mon, 16 Sep 2019 17:24:25 +0300 Subject: [PATCH] Use StandartError over Exception --- README.adoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.adoc b/README.adoc index 1bd283724..27c19249e 100644 --- a/README.adoc +++ b/README.adoc @@ -1931,6 +1931,19 @@ end Prefer the use of exceptions from the standard library over introducing new exception classes. +=== Do not `raise` `Exception` [[raise-exception]] + +Use `StandardError` over `Exception`. + +[source,ruby] +---- +# bad +raise Exception, 'Error message here' + +# good +raise StandardError, 'Error message here' +---- + == Assignment & Comparison === Parallel Assignment [[parallel-assignment]]