uc3-dmp-external-api 0.0.22 → 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: 1a92ee0736f47ac2ff52f7e661c150e80ede4a2fe5a6950d3299487fb33834c1
4
- data.tar.gz: 0745cacf33055db58fa55249eb4c16cdfec483179cc27cec153669c28d8cd5ed
3
+ metadata.gz: 65ca811589cea83fa2f7845e936c511edcd8b59c90cc93ca3e581631cf909aeb
4
+ data.tar.gz: a13f374047dea33da68debe60dcbc3c03a6dd9679e96f425182967b367600aca
5
5
  SHA512:
6
- metadata.gz: 683297d4cfb646b905e7527c382f785a15e0a7a33800a232021d65974210288cc57ec1b71a5546d57b0e0afd93d9ec2704ae0a3c683aae8d2072aaba4e3eb055
7
- data.tar.gz: 1897e1b7d8430bc120ec8908f71c11e8e1d9f5f5024447390db468990743930d74860c5c11589aae87d4fceccd00cb312b29d221dcfbeef1f025c46e74018a1c
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.22'
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.22
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-05-29 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