Sha256: 5e600fe5af937b4ef6a67e42359ffdf396ea52d2b061f13fbfbd780e3b1cd995

Contents?: true

Size: 297 Bytes

Versions: 10

Compression:

Stored size: 297 Bytes

Contents

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

    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

10 entries across 10 versions & 1 rubygems

Version Path
salesforce_streamer-2.12.1 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.12.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.11.2 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.11.1 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.11.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.10.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.9.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.8.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.6.0 lib/salesforce_streamer/replay_id_error_extension.rb
salesforce_streamer-2.5.0 lib/salesforce_streamer/replay_id_error_extension.rb