Class: Datalab::ErrorResult
- Inherits:
-
Object
- Object
- Datalab::ErrorResult
- Defined in:
- lib/datalab/error_result.rb
Instance Attribute Summary collapse
-
#error_description ⇒ Object
readonly
Returns the value of attribute error_description.
-
#error_type ⇒ Object
readonly
Returns the value of attribute error_type.
Instance Method Summary collapse
-
#initialize(status_code, attributes = nil) ⇒ ErrorResult
constructor
A new instance of ErrorResult.
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 = detail[ :msg ] @error_description = if location = detail[ :loc ] @error_description += " : " + [ location ].flatten.join( '/' ) end end end end |
Instance Attribute Details
#error_description ⇒ Object (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_type ⇒ Object (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 |