Exception: Cortex::ClientExceptions::ErrorFromResult

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cortex/client_exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg) ⇒ ErrorFromResult

Returns a new instance of ErrorFromResult.



5
6
7
8
9
10
# File 'lib/cortex/client_exceptions.rb', line 5

def initialize(arg)
  throw ArgumentError.new(msg: "Expected: Cortex::Result, Received: #{arg.class}") unless arg.is_a?(Cortex::Result)
  @status = arg.status
  @errors = arg.errors
  @contents = arg.contents
end

Instance Attribute Details

#contentsObject

Returns the value of attribute contents.



4
5
6
# File 'lib/cortex/client_exceptions.rb', line 4

def contents
  @contents
end

#errorsObject

Returns the value of attribute errors.



4
5
6
# File 'lib/cortex/client_exceptions.rb', line 4

def errors
  @errors
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/cortex/client_exceptions.rb', line 4

def status
  @status
end