lib/quandl/command/presenter/record.rb in quandl-0.3.0 vs lib/quandl/command/presenter/record.rb in quandl-0.3.3
- old
+ new
@@ -91,20 +91,12 @@
def errors_without_spaces
errors.to_s.gsub("\n", ' ')
end
def errors
- result = []
messages = object.try(:error_messages) || []
- # extract repsonse errors
- re = messages.delete(:response_errors) if messages.is_a?(Hash) && messages.has_key?(:response_errors)
- re.each{|k,v| messages[k] = v } if re.present? && re.is_a?(Hash)
- # format
- messages.each do |k,v|
- v = v.join(" & ") if v.respond_to?(:join)
- result << "#{k}: #{v}"
- end
- result.join(", ")
+ # extract response errors
+ Presenter.pretty_errors(messages)
end
def docs?
options[:type] == :docs
end
\ No newline at end of file