Class: Google::Cloud::PubSub::OrderingKeyError

Inherits:
Error
  • Object
show all
Defined in:
lib/google/cloud/pubsub/errors.rb

Overview

Indicates that messages using the #ordering_key are not being published due to error. Future calls to Topic#publish_async with the #ordering_key will fail with this error.

To allow future messages with the #ordering_key to be published, the #ordering_key must be passed to Topic#resume_publish.

If this error is retrieved from PublishResult#error, inspect cause for the error raised while publishing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ordering_key) ⇒ OrderingKeyError

Returns a new instance of OrderingKeyError.



75
76
77
78
79
# File 'lib/google/cloud/pubsub/errors.rb', line 75

def initialize ordering_key
  @ordering_key = ordering_key

  super "Can't publish message using #{ordering_key}."
end

Instance Attribute Details

#ordering_keyString (readonly)

Returns The ordering key that is in a failed state.

Returns:

  • (String)

    The ordering key that is in a failed state.



72
73
74
75
76
77
78
79
80
# File 'lib/google/cloud/pubsub/errors.rb', line 72

class OrderingKeyError < Google::Cloud::Error
  attr_reader :ordering_key

  def initialize ordering_key
    @ordering_key = ordering_key

    super "Can't publish message using #{ordering_key}."
  end
end