# Cloud Pub/Sub API - Class Google::Cloud::PubSub::OrderingKeyError (v3.3.0)

3.3.0 (latest) 3.2.1 3.1.1 3.0.3 2.23.0 2.22.0 2.21.0 2.20.0 2.19.0 2.18.1 2.17.0 2.16.0 2.15.5 2.14.0 2.12.1 2.11.0 2.10.0 2.9.2 Reference documentation and code samples for the Cloud Pub/Sub API class Google::Cloud::PubSub::OrderingKeyError.

Indicates that messages using the [#ordering_key](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub/latest/Google-Cloud-PubSub-OrderingKeyError#Google__Cloud__PubSub__OrderingKeyError_ordering_key_instance_ "Google::Cloud::PubSub::OrderingKeyError#ordering_key (method)") are not being
published due to error. Future calls to [Publisher#publish_async](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub/latest/Google-Cloud-PubSub-Publisher#Google__Cloud__PubSub__Publisher_publish_async_instance_ "Google::Cloud::PubSub::Publisher#publish_async (method)") with the
[#ordering_key](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub/latest/Google-Cloud-PubSub-OrderingKeyError#Google__Cloud__PubSub__OrderingKeyError_ordering_key_instance_ "Google::Cloud::PubSub::OrderingKeyError#ordering_key (method)") will fail with this error.


To allow future messages with the [#ordering_key](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub/latest/Google-Cloud-PubSub-OrderingKeyError#Google__Cloud__PubSub__OrderingKeyError_ordering_key_instance_ "Google::Cloud::PubSub::OrderingKeyError#ordering_key (method)") to be published, the
[#ordering_key](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub/latest/Google-Cloud-PubSub-OrderingKeyError#Google__Cloud__PubSub__OrderingKeyError_ordering_key_instance_ "Google::Cloud::PubSub::OrderingKeyError#ordering_key (method)") must be passed to [Publisher#resume_publish](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub/latest/Google-Cloud-PubSub-Publisher#Google__Cloud__PubSub__Publisher_resume_publish_instance_ "Google::Cloud::PubSub::Publisher#resume_publish (method)").

<br />

If this error is retrieved from [PublishResult#error](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub/latest/Google-Cloud-PubSub-PublishResult#Google__Cloud__PubSub__PublishResult_error_instance_ "Google::Cloud::PubSub::PublishResult#error (method)"), inspect `cause`
for the error raised while publishing.

## Inherits

- Google::Cloud::Error

## Methods

### #initialize

    def initialize(ordering_key) -> OrderingKeyError

**Returns**

- ([OrderingKeyError](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-pubsub/latest/Google-Cloud-PubSub-OrderingKeyError)) --- a new instance of OrderingKeyError

### #ordering_key

    def ordering_key() -> String

**Returns**

- (String) --- The ordering key that is in a failed state.