Class: WorkflowTemplate::Fatal::ArgumentError

Inherits:
Fatal
  • Object
show all
Defined in:
lib/workflow_template/error.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_name, message) ⇒ ArgumentError

Returns a new instance of ArgumentError.



8
9
10
11
12
# File 'lib/workflow_template/error.rb', line 8

def initialize(action_name, message)
  full_message = "Argument mismatch in '#{action_name}': #{message}"

  super(full_message)
end

Class Method Details

.depth(argument_error, method) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/workflow_template/error.rb', line 14

def self.depth(argument_error, method)
  path, = method.source_location
  label = method.name.to_s
  _, index = argument_error.backtrace_locations.each_with_index.find do |location, _index|
    location.label == label && location.path == path
  end

  index
end