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
It would be cool to have #wrap or #chain method to wrap error instead of passing it to new.
Example
classMyErrorincludeNesty::NestedErrorendbeginboooom!rescueNoMethodError=>original_errormy_error=MyError.custom_method_to_build_error_message(with,number,of,parameters)my_error.wrap(original_error)# That's where I would like to use itraisemy_errorend
Also I can pass original_error to MyError.custom_method_to_build_error_message as additional parameter but I would prefer avoid doing this to not overload interface with parameters and to make it more reusable.
Thanks.
The text was updated successfully, but these errors were encountered:
It would be cool to have
#wrap
or#chain
method to wrap error instead of passing it tonew
.Example
Also I can pass
original_error
toMyError.custom_method_to_build_error_message
as additional parameter but I would prefer avoid doing this to not overload interface with parameters and to make it more reusable.Thanks.
The text was updated successfully, but these errors were encountered: