Sha256: 0f524a1ab5669b622e903d9761ed8fd79164e91c5aa20a3a050a520f8a341337

Contents?: true

Size: 644 Bytes

Versions: 12

Compression:

Stored size: 644 Bytes

Contents

module Rpush
  class DeliveryError < StandardError
    attr_reader :code, :notification_id

    def initialize(code, notification_id, description)
      @code = code
      @notification_id = notification_id
      @description = description
    end

    def to_s
      message
    end

    def message
      error_str = [@code, "(#{@description})"].compact.join(' ')
      "Unable to deliver notification #{@notification_id}, received error #{error_str}"
    end

    def ==(other)
      other.is_a?(DeliveryError) && \
      other.code == code && \
      other.notification_id == notification_id && \
      other.to_s == to_s
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rpush-2.2.0-java lib/rpush/daemon/delivery_error.rb
rpush-2.2.0 lib/rpush/daemon/delivery_error.rb
rpush-2.1.0-java lib/rpush/daemon/delivery_error.rb
rpush-2.1.0 lib/rpush/daemon/delivery_error.rb
rpush-2.0.1-java lib/rpush/daemon/delivery_error.rb
rpush-2.0.1 lib/rpush/daemon/delivery_error.rb
rpush-2.0.0-java lib/rpush/daemon/delivery_error.rb
rpush-2.0.0 lib/rpush/daemon/delivery_error.rb
rpush-2.0.0.rc1-java lib/rpush/daemon/delivery_error.rb
rpush-2.0.0.rc1 lib/rpush/daemon/delivery_error.rb
rpush-2.0.0.beta2 lib/rpush/daemon/delivery_error.rb
rpush-2.0.0.beta1 lib/rpush/daemon/delivery_error.rb