Exception: Compote::ConfigRecursionError

Inherits:
Error
  • Object
show all
Defined in:
lib/compote/error.rb

Instance Attribute Summary

Attributes inherited from Error

#message

Instance Method Summary collapse

Constructor Details

#initialize(path:, origin_config:, configs:) ⇒ ConfigRecursionError

Returns a new instance of ConfigRecursionError.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/compote/error.rb', line 40

def initialize ( path:, origin_config:, configs: )

  message = "Error loading config file: Recursive loading of config files - #{ path }."

  message += "\n\n" + "Requiring trace:"

  message += "\n" + "#{ path }"

  requiring_path = origin_config.file_name

  loop do

    message += "\n" + "#{ requiring_path }"

    requiring_path = configs[ requiring_path ]

    break if requiring_path == path

  end

  super message

end