kura 0.2.7 → 0.2.8

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: 39922e26110ff492d11e7e1bf9fa774cfeb5139e
4
- data.tar.gz: 9cbab5d9463b9df6b5cb4c1ac0f0cd535bb906dd
3
+ metadata.gz: 0b88dd23727be1e2392bcd74b99be5d88d1ccbee
4
+ data.tar.gz: ec936aaef68ac2dafc299555139132b108367d91
5
5
  SHA512:
6
- metadata.gz: 2921b4b127d0bb7e2eb9b209793f1851311a3a1a049aa0c10096532430c967d34dcd1e9c13e23f82a7952a89a57ef004239bcf1c26f337f5009b37556523c5f5
7
- data.tar.gz: 8cc2d5a7e16194bab35a445072845e067b5ac0466dd1d8fd40ca64477274e4ebe9dcb11f095638db9d2061ed61afd23ba72c33d85ed6d53327acecdfabcd4b58
6
+ metadata.gz: fff8a43f1ca5095c46c2216e344b040837372cc41a4be90544b5771128deee26ae19a0bf20d69b0dd739f494f9e5e3ec0df1c7de611999e134a2f1219e4aecd1
7
+ data.tar.gz: cd52564a9ab33cf1a2f7bd72113ce4ae929a694425f8a527fb53913b4281b03575cb6c42705bb761200d4e2c38671cd668e2c96165d1469eb34f8f4183b99342
data/ChangeLog.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.2.8
2
+
3
+ ## Fixes
4
+
5
+ * BigQuery API rarely return HTML response body. Add treatment for the case.
6
+
1
7
  # 0.2.7
2
8
 
3
9
  ## Fixes
data/lib/kura/client.rb CHANGED
@@ -38,10 +38,15 @@ module Kura
38
38
 
39
39
  def process_error(err)
40
40
  if err.respond_to?(:body)
41
- jobj = JSON.parse(err.body)
42
- error = jobj["error"]
43
- reason = error["errors"].map{|e| e["reason"]}.join(",")
44
- errors = error["errors"].map{|e| e["message"] }.join("\n")
41
+ begin
42
+ jobj = JSON.parse(err.body)
43
+ error = jobj["error"]
44
+ reason = error["errors"].map{|e| e["reason"]}.join(",")
45
+ errors = error["errors"].map{|e| e["message"] }.join("\n")
46
+ rescue JSON::ParserError
47
+ reason = err.status_code.to_s
48
+ errors = "HTTP Status: #{err.status_code}\nHeaders: #{err.header.inspect}\nBody:\n#{err.body}"
49
+ end
45
50
  raise Kura::ApiError.new(reason, errors)
46
51
  else
47
52
  raise err
data/lib/kura/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kura
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kura
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chikanaga Tomoyuki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-26 00:00:00.000000000 Z
11
+ date: 2015-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client