Class: SpecForge::Error::LoadStepError
- Inherits:
-
Error
- Object
- Error
- SpecForge::Error::LoadStepError
- Defined in:
- lib/spec_forge/error.rb
Overview
Raised when an error occurs while loading a step during blueprint processing
Wraps the original error with step context information to help identify which step caused the problem.
Instance Method Summary collapse
-
#initialize(error, step, depth = 0) ⇒ LoadStepError
constructor
A new instance of LoadStepError.
Constructor Details
#initialize(error, step, depth = 0) ⇒ LoadStepError
Returns a new instance of LoadStepError.
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/spec_forge/error.rb', line 273 def initialize(error, step, depth = 0) step_name = step[:name].presence || "(unnamed)" line_info = if (source = step[:source]) "#{source[:file_name]}:#{source[:line_number]}" end = "Step: #{step_name.in_quotes} [#{line_info}]" = if error.is_a?(LoadStepError) "\n#{error.}" else "\n\nCaused by: \n #{error..gsub("\n", "\n ")}" end super( + ) end |