lib/ensure_it/errors.rb in ensure_it-0.1.0 vs lib/ensure_it/errors.rb in ensure_it-0.1.1
- old
+ new
@@ -62,10 +62,10 @@
def self.raise_error(method_name, message: nil, error: Error, **opts)
error = Error unless error <= Exception
error_msg = ErrorMessage.new(method_name, message, caller[1..-1])
if opts.key?(:smart) && opts[:smart] != true ||
EnsureIt.config.errors != :smart
- raise error_class, error.message, error.backtrace
+ raise error, error_msg.message, error_msg.backtrace
end
raise_smart_error(error_msg, error, **opts)
end
def self.raise_smart_error(error, error_class, **opts)