dmp-dynamo_adapter 0.2.1 → 0.2.2

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 +3 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c4c901b97437913b47803234f1f6bd80dfe048e307c452ce80b174f465d6de2
4
- data.tar.gz: f5583c6531e487250ba8ccb0acf7e600a9ca46f7e8fee702bbc35bc5085e7198
3
+ metadata.gz: 482c56531b1bce877f93b66efbdc8aefc4b2c120b5d81eb3713035dfb546149d
4
+ data.tar.gz: bd9680232b0bbfcf92bdeec0b56ec62f335ccefb52acb9d902fc02e00e73659c
5
5
  SHA512:
6
- metadata.gz: 11246b4c0a980ffd9b4b43b4e9566f1ed29dd4f6db4068a96539cbd5d615bae24a1d720efba00a1bbc54ed3c38fdfa2b0405fd69ce6f1c6a0e2cdd6b73cf4383
7
- data.tar.gz: 9fa961d5cf6405334791cebb57713265dccf5856d8bb853cefa37f0d0a2ab2040dfc88d6678718fae15603c82253d37d26df59d721c69edce529076e5ce0557b
6
+ metadata.gz: 4a2e6307f60b392621225539e2065633a64859b8dbc60bc83fa1cb559b6960d5f581eace2ada534bbce85d5bf009502642f9065e27fff683d57f967298fe415e
7
+ data.tar.gz: dfd6fdaaf576d91b96fcdb37a7ce6f060a66f8d7ae4511205f08106259eecb6104a65f024cbe4c3ebc07e9221e83c266b627caeef7bc0827fb6f85524d6b082e
@@ -105,7 +105,7 @@ p "FINDING BY PK: PK - #{p_key.inspect} / SK - #{s_key.inspect}"
105
105
 
106
106
  # Try to find it first
107
107
  result = find_by_json(json: json)
108
- return { status: 500, error: MSG_DEFAULT } if result[:status] == 500
108
+ return { status: 500, error: result.fetch(:error, MSG_DEFAULT) } if result[:status] == 500
109
109
  # Abort if found
110
110
  return { status: 400, error: MSG_EXISTS } if result[:items].any?
111
111
 
@@ -146,7 +146,7 @@ pp response.data
146
146
 
147
147
  # Try to find it first
148
148
  result = find_by_json(json: json)
149
- return { status: 500, error: MSG_DEFAULT } if result[:status] == 500
149
+ return { status: 500, error: result.fetch(:error, MSG_DEFAULT) } if result[:status] == 500
150
150
 
151
151
  dmp = result[:items].first&.item
152
152
  return { status: 404, error: MSG_NOT_FOUND } if dmp.nil?
@@ -204,7 +204,7 @@ pp json
204
204
 
205
205
  # Try to find it first
206
206
  result = find_by_json(json: json)
207
- return { status: 500, error: MSG_DEFAULT } if result[:status] == 500
207
+ return { status: 500, error: result.fetch(:error, MSG_DEFAULT) } if result[:status] == 500
208
208
  # Abort if NOT found
209
209
  return { status: 404, error: MSG_NOT_FOUND } unless result[:status] == 200 && result.fetch(:items, []).any?
210
210
 
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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - briri