lib/soapy_cake/response.rb in soapy_cake-1.19.0 vs lib/soapy_cake/response.rb in soapy_cake-1.20.0

- old
+ new

@@ -65,10 +65,11 @@ fail RequestFailed, fault[:reason][:text] if fault end def error_check_success! return if sax.for_tag(:success).first == 'true'.freeze + fail RateLimitError if error_message == 'Restricted'.freeze fail RequestFailed, error_message end def error_check_special_case? # Don't ask... @@ -80,9 +81,9 @@ false end def error_message - sax.for_tag(:message).first || sax.for_tag(:Text).first || 'Unknown error' + @error_message ||= sax.for_tag(:message).first || sax.for_tag(:Text).first || 'Unknown error' end end end