Exception: Aws::Errors::EventError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/aws-sdk-core/errors.rb

Overview

Error event in an event stream which has event_type :error error code and error message can be retrieved when available.

example usage:

client.stream_foo(name: 'bar') do |event|
  stream.on_error_event do |event|
    puts "Error #{event.error_code}: #{event.error_message}"
    raise event
  end
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_type, code, message) ⇒ EventError

Returns a new instance of EventError



79
80
81
82
83
# File 'lib/aws-sdk-core/errors.rb', line 79

def initialize(event_type, code, message)
  @event_type = event_type
  @error_code = code
  @error_message = message
end

Instance Attribute Details

#error_codeString (readonly)

Returns:

  • (String)


89
90
91
# File 'lib/aws-sdk-core/errors.rb', line 89

def error_code
  @error_code
end

#error_messageString (readonly)

Returns:

  • (String)


92
93
94
# File 'lib/aws-sdk-core/errors.rb', line 92

def error_message
  @error_message
end

#event_typeSymbol (readonly)

Returns:

  • (Symbol)


86
87
88
# File 'lib/aws-sdk-core/errors.rb', line 86

def event_type
  @event_type
end