Exception: FilePipeline::Errors::FailedModificationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/file_pipeline/errors/failed_modification_error.rb

Overview

Error class for exceptions that are raised when a a FileOperation in a Pipeline returns failure.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, info: nil) ⇒ FailedModificationError

Returns a new instance of FailedModificationError.



11
12
13
14
15
16
17
18
19
20
# File 'lib/file_pipeline/errors/failed_modification_error.rb', line 11

def initialize(msg = nil, info: nil)
  @info = info
  if info.respond_to?(:operation) && info.respond_to?(:log)
    msg ||= "#{@info.operation&.name} with options"\
            " #{@info.operation&.options} failed, log: #{@info.log}"
  else
    msg ||= 'Operation failed' unless info
  end
  super msg
end

Instance Attribute Details

#infoObject (readonly)

The file opration that caused the error.



9
10
11
# File 'lib/file_pipeline/errors/failed_modification_error.rb', line 9

def info
  @info
end