Skip to content
Browse files

added notify attribute to delivery_error to disable notifications to …

…external services
  • Loading branch information...
1 parent b187896 commit 886c124e29a76dd41ffefe7e47526e245f1b1fe4 @tompesman committed Nov 2, 2012
Showing with 5 additions and 2 deletions.
  1. +3 −2 lib/push/daemon/delivery_error.rb
  2. +2 −0 lib/push/daemon/delivery_handler.rb
View
5 lib/push/daemon/delivery_error.rb
@@ -1,12 +1,13 @@
module Push
class DeliveryError < StandardError
- attr_reader :code, :description
+ attr_reader :code, :description, :notify
- def initialize(code, message_id, description, source)
+ def initialize(code, message_id, description, source, notify = true)
@code = code
@message_id = message_id
@description = description
@source = source
+ @notify = notify
end
def message
View
2 lib/push/daemon/delivery_handler.rb
@@ -35,6 +35,8 @@ def handle_next_notification
begin
connection = @connection_pool.checkout(notification.use_connection)
notification.deliver(connection)
+ rescue DeliveryError => e
+ Push::Daemon.logger.error(e, {:error_notification => e.notify})
rescue StandardError => e
Push::Daemon.logger.error(e)
ensure

0 comments on commit 886c124

Please sign in to comment.
Something went wrong with that request. Please try again.