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.



423
424
425
426
# File 'lib/mb/errors.rb', line 423

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

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



420
421
422
# File 'lib/mb/errors.rb', line 420

def filename
  @filename
end

#required_forObject (readonly)

Returns the value of attribute required_for.



421
422
423
# File 'lib/mb/errors.rb', line 421

def required_for
  @required_for
end

Instance Method Details

#messageObject



428
429
430
431
432
433
# File 'lib/mb/errors.rb', line 428

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