Class: Cuprum::Errors::MultipleErrors

Inherits:
Cuprum::Error show all
Defined in:
lib/cuprum/errors/multiple_errors.rb

Overview

Error wrapping multiple errors from a collection command.

Constant Summary collapse

TYPE =

Short string used to identify the type of error.

'cuprum.errors.multiple_errors'

Instance Attribute Summary collapse

Attributes inherited from Cuprum::Error

#message, #type

Instance Method Summary collapse

Methods inherited from Cuprum::Error

#==, #as_json

Constructor Details

#initialize(errors:, message: nil) ⇒ MultipleErrors

Returns a new instance of MultipleErrors.

Parameters:

  • errors (Array<Cuprum::Error>)

    The wrapped errors.

  • message (String) (defaults to: nil)

    Optional message describing the nature of the error.



15
16
17
18
19
20
21
22
# File 'lib/cuprum/errors/multiple_errors.rb', line 15

def initialize(errors:, message: nil)
  @errors = errors

  super(
    errors:  errors,
    message: message || default_message
  )
end

Instance Attribute Details

#errorsArray<Cuprum::Error> (readonly)

Returns the wrapped errors.

Returns:



25
26
27
# File 'lib/cuprum/errors/multiple_errors.rb', line 25

def errors
  @errors
end