Exception: Slinky::MultiError

Inherits:
SlinkyError show all
Defined in:
lib/slinky/errors.rb

Overview

Raise when there are multiple errors

Instance Attribute Summary collapse

Attributes inherited from SlinkyError

#continuation

Instance Method Summary collapse

Methods inherited from SlinkyError

batch_errors, #continue, raise

Constructor Details

#initialize(errors) ⇒ MultiError

Returns a new instance of MultiError.



74
75
76
77
78
79
80
81
# File 'lib/slinky/errors.rb', line 74

def initialize errors
  @errors = errors.map{|e|
    case e
    when MultiError then e.errors
    else e
    end
  }.flatten
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



72
73
74
# File 'lib/slinky/errors.rb', line 72

def errors
  @errors
end

Instance Method Details

#messageObject



83
84
85
# File 'lib/slinky/errors.rb', line 83

def message
  @errors.map{|e| e.message}.join(", ")
end

#messagesObject



87
88
89
# File 'lib/slinky/errors.rb', line 87

def messages
  @errors.map{|e| e.message}
end