thrift_rack 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e40a0428d460166190b44aff02be27ee45ee56f6
4
- data.tar.gz: 36b6e37828a570654e93b1659e098e0ea38e01f0
3
+ metadata.gz: 773b0e6d88aa7f1985166dc435f1a86e060a37a9
4
+ data.tar.gz: 6086c1097e403a8d0b9a7905a714f2f36e2562e8
5
5
  SHA512:
6
- metadata.gz: 7d0703322c68962056f3bb648390d031d6cb58e4a9bff4f6a202ac0e025a32dcbb382ed3e61b346f39e338dbf94d8e7d15dfcba96d79064710e83aaa404fd3d9
7
- data.tar.gz: 008c47be652f5609dacf18b036a7b0dcb32ce645e3743223b7836952f2cb71dfeea4439e178295355cc69762704881e2d1e8fcda9eb6064341c0cca977e08655
6
+ metadata.gz: 2846261de0e9c65282acd06787d01cb167a2523afa544cf395ad089b643769c5c138e033cf1b0eac327ca75502b416d07860867da673711982809ed5e9490a0d
7
+ data.tar.gz: 933c12c2164c69cd3dcf42507c81edfe0e882435139ebd87620826fabaa875dd4eb950477f855e57dfcc90f0ff92803951180b75decb196defd6b4090e088759
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- thrift_rack (0.1.7)
4
+ thrift_rack (0.1.9)
5
5
  connection_pool (~> 2.2.1)
6
6
  excon (~> 0.62.0)
7
7
  rack (>= 2.0)
@@ -4,6 +4,7 @@ require "stringio"
4
4
  Excon.defaults[:ssl_verify_peer] = false
5
5
  class ThriftRack
6
6
  class HttpClientTransport < Thrift::BaseTransport
7
+ class RespCodeError < StandardError; end
7
8
  def initialize(client, path, opts = {})
8
9
  @headers = {'Content-Type' => 'application/x-thrift'}
9
10
  @outbuf = Thrift::Bytes.empty_byte_buffer
@@ -23,6 +24,7 @@ class ThriftRack
23
24
  def flush
24
25
  resp = @client.post(path: @path, body: @outbuf, headers: @headers, idempotent: true)
25
26
  data = resp.body
27
+ raise RespCodeError.new("#{resp.status} on #{@path} with body #{data}") unless resp.status == 200
26
28
  data = Thrift::Bytes.force_binary_encoding(data)
27
29
  @inbuf = StringIO.new data
28
30
  ensure
@@ -1,3 +1,3 @@
1
1
  class ThriftRack
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thrift_rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - xuxiangyang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-28 00:00:00.000000000 Z
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack