preservation-client 5.2.0 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/Gemfile.lock +6 -5
- data/lib/preservation/client/version.rb +1 -1
- data/lib/preservation/client/versioned_api_service.rb +13 -2
- data/lib/preservation/client.rb +3 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fecead20f03947d189027e250689d1af848866f889dadfd81f553ee3bb00d07b
|
4
|
+
data.tar.gz: fa4aa6b61ac54291a787e91eef05fa63b4c3fb607a4dbbb8e9f29068194510ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fbb241aa2b6422213de3b5b54a76c38a96d1c892b901384472087ee684718b269130522931d806536abea3e30b51edc2396c55b6cdbb00d76ce34c7a17c14c7
|
7
|
+
data.tar.gz: '0986527f81fec0dfdad8faefbcfbcc03dde1066b46382ac34babe5dec7da5459733eec8a6c7bf09c79e0f5b8ac291e177749b7a13f2337f2ac0ae81832bbe5f2'
|
data/.circleci/config.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
preservation-client (5.
|
4
|
+
preservation-client (5.3.0)
|
5
5
|
activesupport (>= 4.2, < 8)
|
6
6
|
faraday (~> 2.0)
|
7
7
|
moab-versioning (>= 5.0.0, < 7)
|
@@ -36,14 +36,14 @@ GEM
|
|
36
36
|
json (2.6.3)
|
37
37
|
method_source (1.0.0)
|
38
38
|
minitest (5.17.0)
|
39
|
-
moab-versioning (6.
|
39
|
+
moab-versioning (6.1.0)
|
40
40
|
druid-tools (>= 1.0.0)
|
41
41
|
json
|
42
42
|
nokogiri
|
43
43
|
nokogiri-happymapper
|
44
|
-
nokogiri (1.14.
|
44
|
+
nokogiri (1.14.1-x86_64-darwin)
|
45
45
|
racc (~> 1.4)
|
46
|
-
nokogiri (1.14.
|
46
|
+
nokogiri (1.14.1-x86_64-linux)
|
47
47
|
racc (~> 1.4)
|
48
48
|
nokogiri-happymapper (0.9.0)
|
49
49
|
nokogiri (~> 1.5)
|
@@ -66,7 +66,7 @@ GEM
|
|
66
66
|
rspec-core (~> 3.12.0)
|
67
67
|
rspec-expectations (~> 3.12.0)
|
68
68
|
rspec-mocks (~> 3.12.0)
|
69
|
-
rspec-core (3.12.
|
69
|
+
rspec-core (3.12.1)
|
70
70
|
rspec-support (~> 3.12.0)
|
71
71
|
rspec-expectations (3.12.2)
|
72
72
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -113,6 +113,7 @@ GEM
|
|
113
113
|
|
114
114
|
PLATFORMS
|
115
115
|
x86_64-darwin-19
|
116
|
+
x86_64-darwin-20
|
116
117
|
x86_64-linux
|
117
118
|
|
118
119
|
DEPENDENCIES
|
@@ -95,8 +95,19 @@ module Preservation
|
|
95
95
|
rescue Faraday::Error => e
|
96
96
|
errmsg = "Preservation::Client.#{caller_locations.first.label} " \
|
97
97
|
"got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
|
98
|
-
|
99
|
-
|
98
|
+
raise http_exception_class(e.response[:status]), errmsg
|
99
|
+
end
|
100
|
+
|
101
|
+
# @param status_code [Integer] the HTTP status code to translate to an exception class
|
102
|
+
def http_exception_class(status_code)
|
103
|
+
case status_code
|
104
|
+
when 423
|
105
|
+
LockedError
|
106
|
+
when 409
|
107
|
+
ConflictError
|
108
|
+
else
|
109
|
+
UnexpectedResponseError
|
110
|
+
end
|
100
111
|
end
|
101
112
|
end
|
102
113
|
end
|
data/lib/preservation/client.rb
CHANGED
@@ -23,6 +23,9 @@ module Preservation
|
|
23
23
|
# Error raised when server returns 423 Locked
|
24
24
|
class LockedError < Error; end
|
25
25
|
|
26
|
+
# Error raised when server returns 409 Conflict
|
27
|
+
class ConflictError < Error; end
|
28
|
+
|
26
29
|
# Error raised when server returns an unexpected response
|
27
30
|
# e.g., 4xx or 5xx status not otherwise handled
|
28
31
|
class UnexpectedResponseError < Error; end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: preservation-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naomi Dushay
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -240,7 +240,7 @@ metadata:
|
|
240
240
|
homepage_uri: https://github.com/sul-dlss/preservation-client
|
241
241
|
source_code_uri: https://github.com/sul-dlss/preservation-client.
|
242
242
|
rubygems_mfa_required: 'true'
|
243
|
-
post_install_message:
|
243
|
+
post_install_message:
|
244
244
|
rdoc_options: []
|
245
245
|
require_paths:
|
246
246
|
- lib
|
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
256
|
version: '0'
|
257
257
|
requirements: []
|
258
258
|
rubygems_version: 3.2.32
|
259
|
-
signing_key:
|
259
|
+
signing_key:
|
260
260
|
specification_version: 4
|
261
261
|
summary: A thin client for getting info from SDR preservation.
|
262
262
|
test_files: []
|