Exception: Feathr::Api::FeathrError
- Inherits:
-
StandardError
- Object
- StandardError
- Feathr::Api::FeathrError
- Defined in:
- lib/feathr/api/feathr_error.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status:, errors:) ⇒ FeathrError
constructor
A new instance of FeathrError.
- #to_s ⇒ Object
Constructor Details
#initialize(status:, errors:) ⇒ FeathrError
Returns a new instance of FeathrError.
8 9 10 |
# File 'lib/feathr/api/feathr_error.rb', line 8 def initialize(status:, errors:) @status, @errors = status, errors end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
6 7 8 |
# File 'lib/feathr/api/feathr_error.rb', line 6 def errors @errors end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/feathr/api/feathr_error.rb', line 6 def status @status end |
Instance Method Details
#to_s ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/feathr/api/feathr_error.rb', line 12 def to_s str = "" str += "Status #{ status }\n" unless status.to_s.empty? str += if errors.is_a? Hash errors.map{ |k, v| "#{ k }: #{ v }" }.join('; ') elsif errors.is_a? Array errors.join('; ') else errors.to_s end end |