Permalink
Browse files

redo passing parse error

  • Loading branch information...
1 parent a7da429 commit 4c8a197169139ef93f242020fb6ff958b8c88d35 @funny-falcon funny-falcon committed Jan 17, 2014
Showing with 14 additions and 9 deletions.
  1. +3 −3 lib/tarantool/em_db.rb
  2. +3 −0 lib/tarantool/request.rb
  3. +7 −5 lib/tarantool/response.rb
  4. +1 −1 lib/tarantool/version.rb
View
6 lib/tarantool/em_db.rb
@@ -66,7 +66,7 @@ def call(result)
if Exception === (result = _parse_iproto(result))
@feed.call result
else
- @feed.call @response.parse_response(result)
+ @feed.call @response.parse_response_for_cb(result)
end
end
end
@@ -94,7 +94,7 @@ def call(result=INITIAL)
when Exception
@feed.call result
else
- @feed.call @response.parse_response(result)
+ @feed.call @response.parse_response_for_cb(result)
end
end
end
@@ -131,7 +131,7 @@ def call(result=INITIAL)
@feed.call result
else
@replicas_origin.replace @replicas
- @feed.call @response.parse_response(result)
+ @feed.call @response.parse_response_for_cb(result)
end
end
end
View
3 lib/tarantool/request.rb
@@ -380,6 +380,9 @@ def call_callback(data)
def parse_response(data)
data
end
+ def parse_response_for_cb(data)
+ data
+ end
end
def _ping(cb)
_send_request(all_shards, :write, REQUEST_PING, EMPTY, WrapPing.new(cb))
View
12 lib/tarantool/response.rb
@@ -28,11 +28,7 @@ def call(data)
cb.call(data)
else
if (ret = return_code(data)) == 0
- call_callback begin
- parse_response(data)
- rescue StandardError => e
- e
- end
+ call_callback parse_response_for_cb(data)
else
data.gsub!("\x00", "")
cb.call CODE_TO_EXCEPTION[ret].new(ret, data)
@@ -48,6 +44,12 @@ def call_callback(result)
cb.call(Exception === result || get_tuples != :first ? result : result.first)
end
+ def parse_response_for_cb(data)
+ parse_response data
+ rescue StandardError => e
+ e
+ end
+
def parse_response(data)
return data if Exception === data
unless get_tuples
View
2 lib/tarantool/version.rb
@@ -1,4 +1,4 @@
module Tarantool
- VERSION = "0.4.3.7"
+ VERSION = "0.4.3.8"
RECORD_VERSION = "0.4.2.1"
end

0 comments on commit 4c8a197

Please sign in to comment.