It would be cool to have #wrap or #chain method to wrap error instead of passing it to new.
Example
class MyError
include Nesty::NestedError
end
begin
boooom!
rescue NoMethodError => original_error
my_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 it
raise my_error
end
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.
It would be cool to have
#wrapor#chainmethod to wrap error instead of passing it tonew.Example
Also I can pass
original_errortoMyError.custom_method_to_build_error_messageas additional parameter but I would prefer avoid doing this to not overload interface with parameters and to make it more reusable.Thanks.