Sha256: 4a8dff889f3f6a1f0f82dd774477c867f56a89134fadce4a248cbc12ba8603fa

Contents?: true

Size: 304 Bytes

Versions: 17

Compression:

Stored size: 304 Bytes

Contents

module SalesforceStreamer
  class ReplayIdErrorExtension
    REPLAY_ERROR_REGEX = /^400::The replayId /.freeze

    def incoming(message, callback)
      if message['error']&.match?(REPLAY_ERROR_REGEX)
        fail ReplayIdError, message['error']
      end

      callback.call message
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
salesforce_streamer-2.4.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.4.0.rc1 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.3.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.2.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.1.1 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.1.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.0.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.0.0.rc2 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.0.0.rc1 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-1.2.2 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-1.2.1 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-1.2.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-1.1.3 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-1.1.1 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-1.1.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-1.0.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-0.5.0 lib/salesforce_streamer/replay_id_error_extension.rb