You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ruby allows raise <ExceptionType>, <message> which it then translates into raise <ExceptionType>.new(<message>).
I think most people prefer the former, but my project prefers the latter. I think there should be a cop that enforces one or the other and which form should be configurable.
The text was updated successfully, but these errors were encountered:
Btw, what about the scenario when raise is called with 3 arguments - raise ExceptionClass, message, backtrace? AFAIK you cannot pass the backtrace to the Exception constructor, so that would introduce an inconsistency. Or I just might be missing something.
I guess the specific exception class being raised could take a backtrace argument and call set_backtrace internally, but RuboCop can't be expected to know that. So I say you should allow raise with 3 arguments, or possibly have a configuration parameter called AllowRaiseWithThreeArguments or something, trueby default.
Ruby allows
raise <ExceptionType>, <message>
which it then translates intoraise <ExceptionType>.new(<message>)
.I think most people prefer the former, but my project prefers the latter. I think there should be a cop that enforces one or the other and which form should be configurable.
The text was updated successfully, but these errors were encountered: