uc3-dmp-external-api 0.0.21 → 0.0.24

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: f8c058494e86730fdf579547d77158e5cb95679462ce49f3347b238aaef2dc8a
4
- data.tar.gz: 7a14528690fa6ae96f199cd2fe108152b4734097570034e32bcd1382b3ab83cd
3
+ metadata.gz: 65ca811589cea83fa2f7845e936c511edcd8b59c90cc93ca3e581631cf909aeb
4
+ data.tar.gz: a13f374047dea33da68debe60dcbc3c03a6dd9679e96f425182967b367600aca
5
5
  SHA512:
6
- metadata.gz: 2c923762dc8496373a5642b8a3da41e0c256ccb6a511a5f1c197cae2722e501616812f34c36aab5878b006a42ab45f1c55c235c5af0be5069063acec4b2a9a6d
7
- data.tar.gz: 2425c8fe5001b00f24bd5de0c569be9ee465f3f4d8b0a793120ff834d49c07e1c07a92c90d194bfb5121658525374c8ba3ba73f832bdc6d1b0b722aae3d5e203
6
+ metadata.gz: 5ab703d064d9fd86f9968ccfcc3cf07976c345dcd962953427cf18a89245f16aad44dfcd764c9903a9b9df314bb57853d7302147428686b684739c40bfd1475b
7
+ data.tar.gz: bc3a2c08c2f0e6d8cee707fdad85fbed85b5042891258e33962fde38a000eb1cb8616fca797ed941607e32da05c4fdecfb5ca2dfcd790fe2af33dc045702c1f1
@@ -25,11 +25,13 @@ module Uc3DmpExternalApi
25
25
  opts = _options(body:, basic_auth:, additional_headers:, timeout:, logger:)
26
26
  resp = HTTParty.send(method.to_sym, uri, opts)
27
27
 
28
- unless [200, 201].include?(resp.code)
29
- msg = "status: #{resp&.code}, body: #{resp&.body}"
30
- raise ExternalApiError, "#{format(MSG_ERROR_FROM_EXTERNAL_API, url:)} - #{msg}"
28
+ if [200, 201].include?(resp.code.to_i)
29
+ return resp.body.nil? || resp.body.empty? ? nil : _process_response(resp:)
30
+ else
31
+ logger&.warn(message: "#{format(MSG_ERROR_FROM_EXTERNAL_API, url:)} - HTTP status code #{resp.code}")
32
+ return nil
31
33
  end
32
- resp.body.nil? || resp.body.empty? ? nil : _process_response(resp:)
34
+
33
35
  rescue JSON::ParserError
34
36
  raise ExternalApiError, format(MSG_UNABLE_TO_PARSE, url:)
35
37
  rescue HTTParty::Error => e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpExternalApi
4
- VERSION = '0.0.21'
4
+ VERSION = '0.0.24'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-external-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-24 00:00:00.000000000 Z
11
+ date: 2025-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sns
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
- rubygems_version: 3.4.22
170
+ rubygems_version: 3.5.13
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: DMPTool gem that provides general support for accessing external APIs