lib/telegram/bot/exceptions/response_error.rb in telegram-bot-ruby-0.3.10 vs lib/telegram/bot/exceptions/response_error.rb in telegram-bot-ruby-0.3.11

- old
+ new

@@ -11,9 +11,13 @@ def to_s super + format(' (%s)', data.map { |k, v| %(#{k}: "#{v}") }.join(', ')) end + def error_code + data[:error_code] || data["error_code"] + end + private def data @data ||= begin JSON.parse(response.body)