lib/twitter/rest/api/utils.rb in twitter-5.5.0 vs lib/twitter/rest/api/utils.rb in twitter-5.5.1

- old
+ new

@@ -142,11 +142,11 @@ response = send(request_method.to_sym, path, options) Twitter::Cursor.from_response(response, collection_name.to_sym, klass, self, request_method, path, options) end def handle_forbidden_error(klass, error) - error = error.message == klass::MESSAGE ? klass.new : error - fail error + error = klass.new(error) if error.message == klass::MESSAGE + fail(error) end def merge_default_cursor!(options) options[:cursor] = DEFAULT_CURSOR unless options[:cursor] end