dor-services-client 6.3.1 → 6.4.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 212b5cda775f8e4d306ad5c54f3e0c7244999d32d4af09de08be70e760b80068
|
4
|
+
data.tar.gz: bbc3443ebcfedf85475a58a6c7ec7073d4daf812efea14a445e58ccd80e891f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cd861e067727b8912739db8917e9a594408a40b628c5a19960786aeea1a688e2a92b380de4215d42b6c4dfaeb6bc0a237402d778a16fb17cb34dfbc2edfa915
|
7
|
+
data.tar.gz: e501baf1787189d55453dc5c252232fbc8b6af80c4ef65b1878ad5da5685c6294bd254e1e9b4bc2fe2be1b8ebf7abd45e9949aa520a951010dffeaf0f7f003cc
|
data/lib/dor/services/client.rb
CHANGED
@@ -36,6 +36,9 @@ module Dor
|
|
36
36
|
# Error that is raised when the remote server returns a 401 Unauthorized
|
37
37
|
class UnauthorizedResponse < UnexpectedResponse; end
|
38
38
|
|
39
|
+
# Error that is raised when the remote server returns a 409 Conflict
|
40
|
+
class ConflictResponse < UnexpectedResponse; end
|
41
|
+
|
39
42
|
# Error that is raised when the remote server returns some unparsable response
|
40
43
|
class MalformedResponse < Error; end
|
41
44
|
|
@@ -19,18 +19,22 @@ module Dor
|
|
19
19
|
|
20
20
|
attr_reader :connection, :api_version
|
21
21
|
|
22
|
+
# rubocop:disable Metrics/MethodLength
|
22
23
|
def raise_exception_based_on_response!(response, object_identifier = nil)
|
23
24
|
exception_class = case response.status
|
24
25
|
when 404
|
25
26
|
NotFoundResponse
|
26
27
|
when 401
|
27
28
|
UnauthorizedResponse
|
29
|
+
when 409
|
30
|
+
ConflictResponse
|
28
31
|
else
|
29
32
|
UnexpectedResponse
|
30
33
|
end
|
31
34
|
raise exception_class,
|
32
35
|
ResponseErrorFormatter.format(response: response, object_identifier: object_identifier)
|
33
36
|
end
|
37
|
+
# rubocop:enable Metrics/MethodLength
|
34
38
|
end
|
35
39
|
end
|
36
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-services-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-05-
|
12
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|