Class: Aws::Xray::DefaultErrorHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/xray/error_handlers.rb

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ DefaultErrorHandler

Returns a new instance of DefaultErrorHandler.

Parameters:

  • io (IO)


5
6
7
# File 'lib/aws/xray/error_handlers.rb', line 5

def initialize(io)
  @io = io
end

Instance Method Details

#call(error, payload, host:, port:) ⇒ Object

Parameters:

  • error (Exception)
  • payload (String)
  • host (String, nil)
  • port (Integer, nil)


13
14
15
16
17
18
19
20
21
# File 'lib/aws/xray/error_handlers.rb', line 13

def call(error, payload, host:, port:)
  @io.puts(<<-EOS)
Failed to send a segment to #{host}:#{port}:
Segment:
#{payload}
Error: #{error}
#{error.backtrace.join("\n")}
  EOS
end