Class: ActiveRecord::DatabaseConnectionError

Inherits:
ConnectionNotEstablished
  • Object
show all
Defined in:
lib/active_record/connection_adapters/trilogy_adapter.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil) ⇒ DatabaseConnectionError

Returns a new instance of DatabaseConnectionError.



13
14
15
# File 'lib/active_record/connection_adapters/trilogy_adapter.rb', line 13

def initialize(message = nil)
  super(message || "Database connection error")
end

Class Method Details

.hostname_error(hostname) ⇒ Object



18
19
20
21
22
23
# File 'lib/active_record/connection_adapters/trilogy_adapter.rb', line 18

def hostname_error(hostname)
  DatabaseConnectionError.new(<<~MSG)
    There is an issue connecting with your hostname: #{hostname}.\n
    Please check your database configuration and ensure there is a valid connection to your database.
  MSG
end

.username_error(username) ⇒ Object



25
26
27
28
29
30
# File 'lib/active_record/connection_adapters/trilogy_adapter.rb', line 25

def username_error(username)
  DatabaseConnectionError.new(<<~MSG)
    There is an issue connecting to your database with your username/password, username: #{username}.\n
    Please check your database configuration to ensure the username/password are valid.
  MSG
end