Exception: ActiveRecordDoctor::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/active_record_doctor/errors.rb,
lib/active_record_doctor/errors.rb

Overview

Generic active_record_doctor exception class.

Defined Under Namespace

Classes: ConfigurationError, ConfigurationFileMissing, ConfigureCalledTwice, ConfigureNotCalled, DetectorConfiguredTwice, DuplicateGlobalSetting, UnrecognizedDetectorName, UnrecognizedDetectorSettings, UnrecognizedGlobalSetting

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#config_pathObject

Returns the value of attribute config_path.



13
14
15
# File 'lib/active_record_doctor/errors.rb', line 13

def config_path
  @config_path
end

Class Method Details

.[](*args) ⇒ Object



15
16
17
# File 'lib/active_record_doctor/errors.rb', line 15

def self.[](*args)
  new(*args)
end

Instance Method Details

#detailsObject



19
20
21
# File 'lib/active_record_doctor/errors.rb', line 19

def details
  nil
end

#user_messageObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/active_record_doctor/errors.rb', line 23

def user_message
  result =
    "active_record_doctor aborted due to the following error:\n\#{message}\n\nConfiguration file:\n\#{config_path_or_message}\n"

  if details
    result << (
      "\nAdditional information:\n\#{details}\n"
    )
  end

  result
end