dmp-dynamo_adapter 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dmp/dynamo_adapter.rb +6 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0bf9a1c860911aa89f60a60dce597a07c6721b5eec655d45b97a8ee394249c8
4
- data.tar.gz: 144963e2c761acbb18285f508648c9940b73ba0c04f18c96102da4530caf86b1
3
+ metadata.gz: a38cf33054966d1ad251334ff69c9c120810f574c68366675a3b067c63976518
4
+ data.tar.gz: efd50976eedd2b51a7c2a3877fc949b0fb99ce4162ee8f513f8edcf0385a3bd2
5
5
  SHA512:
6
- metadata.gz: ad012db60a41f6c3e1ec979df1ce3410de618e8e70efe43897ace24ea0fc5aed6d29e95c7fc2282de840f58b89849883ff4fe738c980c66d878d9c27ba39b5eb
7
- data.tar.gz: 908957cd229392f7d2a3a0d4b127cb80db7bf01cfca9da082fcc1dc12f600e72bfcac89aee21cba6da7296506dc5c13acfbd3a84d4e6a0929f291f0def1db9f2
6
+ metadata.gz: a14dea8426ac97c743d420f3952a5d7e56cb6a95749e9f32390ca74791ac085ebdfe90381a0fd990cf3547bb3d5fcae5b78300533871a9d11892f3074ed005f8
7
+ data.tar.gz: f35b4a2a51461faf6023ec3a08f973c88f7bd379b13037e7df65cb703368bf39ca09d35ddb289e23d74c0b7dec95e1043cb3f9a85e57880d03e3a253d3a17f83
@@ -49,8 +49,8 @@ module Dmp
49
49
  }
50
50
  )
51
51
  { status: 200, items: response.items.map(&:item).compact.uniq }
52
- rescue Aws::Errors::ServiceError
53
- { status: 500, error: MSG_DEFAULT }
52
+ rescue Aws::Errors::ServiceError => e
53
+ { status: 500, error: "#{MSG_DEFAULT} - #{e.message}" }
54
54
  end
55
55
  # rubocop:enable Metrics/MethodLength
56
56
 
@@ -58,6 +58,8 @@ module Dmp
58
58
  def find_by_pk(p_key:, s_key: Dmp::MetadataHandler::LATEST_VERSION)
59
59
  return { status: 404, error: MSG_NOT_FOUND } if p_key.nil?
60
60
 
61
+ s_key = Dmp::MetadataHandler::LATEST_VERSION if s_key.nil? || s_key.strip == ''
62
+
61
63
  p "FINDING BY PK: PK - #{p_key.inspect} / SK - #{s_key.inspect}"
62
64
 
63
65
  response = @client.get_item(
@@ -71,8 +73,8 @@ p "FINDING BY PK: PK - #{p_key.inspect} / SK - #{s_key.inspect}"
71
73
  return { status: 404, error: MSG_NOT_FOUND } if response.items.empty?
72
74
 
73
75
  { status: 200, items: response.items.map(&:item).compact.uniq }
74
- rescue Aws::Errors::ServiceError
75
- { status: 500, error: MSG_DEFAULT }
76
+ rescue Aws::Errors::ServiceError => e
77
+ { status: 500, error: "#{MSG_DEFAULT} - #{e.message}" }
76
78
  end
77
79
 
78
80
  # Find a DMP based on the contents of the incoming JSON
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dmp-dynamo_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - briri