Skip to content

Commit 4998ad3

Browse files
committed
Raises Aws::DynamoDB::Errors::ResourceNotFoundException when saving on an unexisting table
1 parent 2042b69 commit 4998ad3

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

lib/dynamoid/persistence.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,6 @@ def save(options = {})
520520
Save.call(self, touch: options[:touch])
521521
end
522522
end
523-
rescue Aws::DynamoDB::Errors::ResourceNotFoundException => error
524-
Dynamoid.logger.error(error)
525-
return false
526523
end
527524

528525
# Update multiple attributes at once, saving the object once the updates

spec/dynamoid/persistence_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,12 +2308,12 @@ def around_update_callback
23082308
end
23092309
end
23102310

2311-
it 'does not create table' do
2311+
it 'raises Aws::DynamoDB::Errors::ResourceNotFoundException error' do
23122312
model = klass.new
23132313

23142314
expect(klass).not_to receive(:create_table)
23152315

2316-
model.save
2316+
expect { model.save! }.to raise_error(Aws::DynamoDB::Errors::ResourceNotFoundException)
23172317
end
23182318
end
23192319

0 commit comments

Comments
 (0)