lib/arthropod/server.rb in arthropod-0.0.1 vs lib/arthropod/server.rb in arthropod-0.0.2
- old
+ new
@@ -8,10 +8,13 @@
sender_queue = client.create_queue(queue_name: queue_name)
response = client.receive_message(queue_url: sender_queue.queue_url, max_number_of_messages: 1, wait_time_seconds: 1)
response.messages.each do |message|
request = Arthropod::Request.new(client: client, message: message)
begin
- request.close(yield request)
+ request.close!(yield request)
+ rescue => error
+ request.error!
+ raise error
ensure
client.delete_message(queue_url: sender_queue.queue_url, receipt_handle: message.receipt_handle)
end
end
end