arvados 2.3.3 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arvados.rb +24 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c45d6de575df79d6bf649e8f549b5fd429c108d7ebedf8a949bc100a68cefdc8
|
4
|
+
data.tar.gz: 06aaee486049713794ddf2ff2d48a669b7deed7474e51f4564c44fceb0b6c469
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9e558450dcb390f4c78f8ef918f513692c55c5171fc78e8047a9fe161e86f419cc7a3e43b28e541ee3cbad183f0c6ee5504c34c16457cb4113b988c152b3700
|
7
|
+
data.tar.gz: 559165823ba689fec94dc539890650de9d96d468b25efacb893501bcbfdde28f4d04bc00a0b12fe211d9ab8019593d2a42654cb85a3fe86541f2f9ac90d44c87
|
data/lib/arvados.rb
CHANGED
@@ -16,6 +16,26 @@ ActiveSupport::Inflector.inflections do |inflect|
|
|
16
16
|
end
|
17
17
|
|
18
18
|
class Arvados
|
19
|
+
class ArvadosClient < Google::APIClient
|
20
|
+
attr_reader :request_id
|
21
|
+
|
22
|
+
def execute(*args)
|
23
|
+
@request_id = "req-" + Random::DEFAULT.rand(2**128).to_s(36)[0..19]
|
24
|
+
if args.last.is_a? Hash
|
25
|
+
args.last[:headers] ||= {}
|
26
|
+
args.last[:headers]['X-Request-Id'] = @request_id
|
27
|
+
end
|
28
|
+
begin
|
29
|
+
super(*args)
|
30
|
+
rescue => e
|
31
|
+
if !e.message.match(/.*req-[0-9a-zA-Z]{20}.*/)
|
32
|
+
raise $!, "#{$!} (Request ID: #{@request_id})", $!.backtrace
|
33
|
+
end
|
34
|
+
raise e
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
19
39
|
class TransactionFailedError < StandardError
|
20
40
|
end
|
21
41
|
|
@@ -101,7 +121,7 @@ class Arvados
|
|
101
121
|
end
|
102
122
|
|
103
123
|
def client
|
104
|
-
@client ||=
|
124
|
+
@client ||= ArvadosClient.
|
105
125
|
new(:host => config["ARVADOS_API_HOST"],
|
106
126
|
:application_name => @application_name,
|
107
127
|
:application_version => @application_version.to_s)
|
@@ -207,6 +227,9 @@ class Arvados
|
|
207
227
|
})
|
208
228
|
resp = JSON.parse result.body, :symbolize_names => true
|
209
229
|
if resp[:errors]
|
230
|
+
if !resp[:errors][0].match(/.*req-[0-9a-zA-Z]{20}.*/)
|
231
|
+
resp[:errors][0] += " (#{result.headers['X-Request-Id'] or client.request_id})"
|
232
|
+
end
|
210
233
|
raise Arvados::TransactionFailedError.new(resp[:errors])
|
211
234
|
elsif resp[:uuid] and resp[:etag]
|
212
235
|
self.new(resp)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arvados
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arvados Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -132,7 +132,7 @@ dependencies:
|
|
132
132
|
- - "<"
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '2'
|
135
|
-
description: Arvados client library, git commit
|
135
|
+
description: Arvados client library, git commit f4554a781a3f6806783cbc6f116c3d7e974c6952
|
136
136
|
email: packaging@arvados.org
|
137
137
|
executables: []
|
138
138
|
extensions: []
|