kura 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72bfe38a1cb2d6eb9136e74c92b212abff576b4e
4
- data.tar.gz: b618287bd89c84a42a3347e344ef5a2141d490cc
3
+ metadata.gz: 2ef864675bf919edba8fa7dde30ecb2d6f006743
4
+ data.tar.gz: 03a47e86b36c2592b4da083544862b6372095dc5
5
5
  SHA512:
6
- metadata.gz: 16a14158a42249195698e7bebb5f610239f41da8403518b141021fdfcf7a1d74deadd33833abe128e63ef3228d7ba414b455df131ce1cab804c77fe47a1bd208
7
- data.tar.gz: ddb033f950bd98ba1ad369a80e406418415f0ff7ec68ba6837c08f90ce795e4de143f500ad340f9047b5eb284cacf0cfc99175d2d8841e1f86c63714cb8299ab
6
+ metadata.gz: 11d14b0676eeb2e49c2fa0f08af74c5aee00f8a673778187bea546daf6a5db47cea053ff05b6edeb6215b3ad4658469bd0009a2160fbe6b07e1da02ecdab925a
7
+ data.tar.gz: 5fcfe50b25c5e6da3a6167da831963143859b0fd03655d6d214c8dd4b3b4ded3e2ccf859d8f82eadde39d3406a32572ec798d7e5e6bb9d63225e5a2e392d6623
data/ChangeLog.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 0.2.4
2
+
3
+ ## Enhancements
4
+
5
+ * Kura::ApiError contains all error messages/reasons/locaitions/deubgInfo in
6
+ `errors` fields of response.
7
+
1
8
  # 0.2.3
2
9
 
3
10
  ## Enhancements
data/lib/kura/client.rb CHANGED
@@ -40,8 +40,9 @@ module Kura
40
40
  if err.respond_to?(:body)
41
41
  jobj = JSON.parse(err.body)
42
42
  error = jobj["error"]
43
- error = error["errors"][0]
44
- raise Kura::ApiError.new(error["reason"], error["message"])
43
+ reason = error["errors"].map{|e| e["reason"]}.join(",")
44
+ errors = error["errors"].map{|e| e["message"] }.join("\n")
45
+ raise Kura::ApiError.new(reason, errors)
45
46
  else
46
47
  raise err
47
48
  end
@@ -375,7 +376,13 @@ module Kura
375
376
  def job_finished?(r)
376
377
  if r.status.state == "DONE"
377
378
  if r.status.error_result
378
- raise Kura::ApiError.new(r.status.error_result.reason, r.status.error_result.message)
379
+ raise Kura::ApiError.new(r.status.errors.map(&:reason).join(","),
380
+ r.status.errors.map{|e|
381
+ msg = "reason=#{e.reason} message=#{e.message}"
382
+ msg += " location=#{e.location}" if e.location
383
+ msg += " debug_infoo=#{e.debug_info}" if e.debug_info
384
+ msg
385
+ }.join("\n"))
379
386
  end
380
387
  return true
381
388
  end
data/lib/kura/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kura
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
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.3
4
+ version: 0.2.4
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-10-23 00:00:00.000000000 Z
11
+ date: 2015-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client