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.



121
122
123
124
125
# File 'lib/aws-sdk-core/errors.rb', line 121

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)


131
132
133
# File 'lib/aws-sdk-core/errors.rb', line 131

def error_code
  @error_code
end

#error_messageString (readonly)

Returns:

  • (String)


134
135
136
# File 'lib/aws-sdk-core/errors.rb', line 134

def error_message
  @error_message
end

#event_typeSymbol (readonly)

Returns:

  • (Symbol)


128
129
130
# File 'lib/aws-sdk-core/errors.rb', line 128

def event_type
  @event_type
end