Exception: ChefApply::TextWrapper::InvalidKey

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/chef_apply/text.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, terminus) ⇒ InvalidKey



60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/chef_apply/text.rb', line 60

def initialize(path, terminus)
  line = caller(3, 1).first # 1 - TextWrapper.method_missing
                           # 2 - TextWrapper.initialize
                           # 3 - actual caller
  if line =~ /.*\/lib\/(.*\.rb):(\d+)/
    line = "File: #{$1} Line: #{$2}"
  end

  # Calling back into Text here seems icky, this is an error
  # that only engineering should see.
  message = "i18n key #{path}.#{terminus} does not exist.\n"
  message << "Referenced from #{line}"
  super(message)
end