Exception: MotherBrain::RequiredFileNotFound

Inherits:
MBError
  • Object
show all
Defined in:
lib/mb/errors.rb

Direct Known Subclasses

ValidatorPemNotFound

Constant Summary

Constants inherited from MBError

MBError::DEFAULT_EXIT_CODE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MBError

#error_code, error_code, exit_code, #exit_code, #to_hash, #to_json, #to_s

Constructor Details

#initialize(filename, options = {}) ⇒ RequiredFileNotFound

Returns a new instance of RequiredFileNotFound.



440
441
442
443
# File 'lib/mb/errors.rb', line 440

def initialize(filename, options = {})
  @filename = filename
  @required_for = options[:required_for]
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



437
438
439
# File 'lib/mb/errors.rb', line 437

def filename
  @filename
end

#required_forObject (readonly)

Returns the value of attribute required_for.



438
439
440
# File 'lib/mb/errors.rb', line 438

def required_for
  @required_for
end

Instance Method Details

#messageObject



445
446
447
448
449
450
# File 'lib/mb/errors.rb', line 445

def message
  msg = "#{@filename} does not exist, but is required"
  msg += " for #{@required_for}" if @required_for
  msg += "."
  msg
end