Exception: Mutineer::ProjectLoadError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/mutineer/runner.rb

Overview

Raised when the tool process cannot load a project file: the boot file, a standalone source, or a --require path. The message is redacted and the original exception is not kept as cause, so neither can show the DATABASE_URL password. The CLI maps it to a runtime error (exit 1).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, causes: [], hint: nil) ⇒ ProjectLoadError

Parameters:

  • message (String) —

    the redacted message.

  • causes (Array<String>) (defaults to: []) —

    see #causes.

  • hint (String, nil) (defaults to: nil) —

    see #hint.



46
47
48
49
50
# File 'lib/mutineer/runner.rb', line 46

def initialize(message, causes: [], hint: nil)
  super(message)
  @causes = causes
  @hint = hint
end

Instance Attribute Details

#causes ⇒ Array<String> (readonly)

Returns the redacted Class: message of each exception in the original cause chain, outermost first.

Returns:

  • (Array<String>) —

    the redacted Class: message of each exception in the original cause chain, outermost first.



34
35
36
# File 'lib/mutineer/runner.rb', line 34

def causes
  @causes
end

#hint ⇒ String? (readonly)

Returns an extra line when a source raises NameError (including NoMethodError) and the run has no boot file. Nil for every other load failure, including a NameError in the boot file or a require: file.

Returns:

  • (String, nil) —

    an extra line when a source raises NameError (including NoMethodError) and the run has no boot file. Nil for every other load failure, including a NameError in the boot file or a require: file.



40
41
42
# File 'lib/mutineer/runner.rb', line 40

def hint
  @hint
end