Exception: MotherBrain::InvalidEnvironmentJson

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

Constant Summary

Constants inherited from MBError

MBError::DEFAULT_EXIT_CODE

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(path, json_error = nil) ⇒ InvalidEnvironmentJson

Returns a new instance of InvalidEnvironmentJson.



461
462
463
# File 'lib/mb/errors.rb', line 461

def initialize(path, json_error=nil)
  @path = path
end

Instance Method Details

#messageObject



465
466
467
468
469
# File 'lib/mb/errors.rb', line 465

def message
  msg = "Environment JSON contained in #{path} is invalid."
  msg << "\n#{json_error.message}" if json_error and json_error.responds_to?(:message)
  msg
end