Class: SalesforceStreamer::ReplayIdErrorExtension

Inherits:
Object
  • Object
show all
Defined in:
lib/salesforce_streamer/replay_id_error_extension.rb

Constant Summary collapse

REPLAY_ERROR_REGEX =
/^400::The replayId /

Instance Method Summary collapse

Instance Method Details

#incoming(message, callback) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/salesforce_streamer/replay_id_error_extension.rb', line 5

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

  callback.call message
end