Exception: FilePipeline::Errors::FailedModificationError
- Inherits:
-
StandardError
- Object
- StandardError
- FilePipeline::Errors::FailedModificationError
- 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
-
#info ⇒ Object
readonly
The file opration that caused the error.
Instance Method Summary collapse
-
#initialize(msg = nil, info: nil, file: nil) ⇒ FailedModificationError
constructor
Returns a new instance.
-
#original_backtrace ⇒ Object
Returns the backtrace of the error that caused the exception.
-
#original_error ⇒ Object
Returns the error that caused the exception.
Constructor Details
#initialize(msg = nil, info: nil, file: nil) ⇒ FailedModificationError
Returns a new instance.
Arguments
-
msg- error message for the exception. If none provided, the instance will be initialized with the #default_message.
Options
-
info- a FileOperations::Results object or an object. -
file- path to the file thas was being processed.
22 23 24 25 26 27 |
# File 'lib/file_pipeline/errors/failed_modification_error.rb', line 22 def initialize(msg = nil, info: nil, file: nil) @file = file @info = info msg ||= super msg end |
Instance Attribute Details
#info ⇒ Object (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 |
Instance Method Details
#original_backtrace ⇒ Object
Returns the backtrace of the error that caused the exception.
30 31 32 |
# File 'lib/file_pipeline/errors/failed_modification_error.rb', line 30 def original_backtrace original_error&.backtrace&.join("\n") end |
#original_error ⇒ Object
Returns the error that caused the exception.
35 36 37 |
# File 'lib/file_pipeline/errors/failed_modification_error.rb', line 35 def original_error @info.log.find { |item| item.is_a? Exception } end |