Class: Datalab::ErrorResult

Inherits:
Object
  • Object
show all
Defined in:
lib/datalab/error_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, attributes = nil) ⇒ ErrorResult

Returns a new instance of ErrorResult.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/datalab/error_result.rb', line 6

def initialize( status_code, attributes = nil )
  @error_code, @error_description = status_code_to_error( status_code )
  if detail = attributes[ :detail ]&.first rescue nil
    if message = detail[ :msg ]
      @error_description = message 
      if location = detail[ :loc ]
        @error_description += " : " + [ location ].flatten.join( '/' )
      end 
    end
  end
end

Instance Attribute Details

#error_descriptionObject (readonly)

Returns the value of attribute error_description.



4
5
6
# File 'lib/datalab/error_result.rb', line 4

def error_description
  @error_description
end

#error_typeObject (readonly)

Returns the value of attribute error_type.



4
5
6
# File 'lib/datalab/error_result.rb', line 4

def error_type
  @error_type
end