Exception: Darkroom::ProcessingError

Inherits:
StandardError
  • Object
show all
Includes:
Enumerable
Defined in:
lib/darkroom/errors/processing_error.rb

Overview

Error class used to wrap all accumulated errors encountered during asset processing.

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ ProcessingError

Public: Create a new instance.

errors - Error or Array of errors.



11
12
13
14
15
# File 'lib/darkroom/errors/processing_error.rb', line 11

def initialize(errors)
  @errors = Array(errors)

  super("Errors were encountered while processing assets:\n  #{@errors.map(&:to_s).join("\n  ")}")
end

Instance Method Details

#each(&block) ⇒ Object

Public: Iterate over each error.

block - Block to call and pass each error to.

Yields each error to the provided block.

Returns Enumerator object.



24
25
26
# File 'lib/darkroom/errors/processing_error.rb', line 24

def each(&block)
  @errors.each(&block)
end