Exception: ActiveRecord::DatabaseConnectionError

Inherits:
ConnectionNotEstablished show all
Defined in:
lib/active_record/errors.rb

Overview

Raised when connection to the database could not been established because it was not able to connect to the host or when the authorization failed.

Instance Attribute Summary

Attributes inherited from AdapterError

#connection_pool

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ConnectionNotEstablished

#set_pool

Constructor Details

#initialize(message = nil) ⇒ DatabaseConnectionError

Returns a new instance of DatabaseConnectionError.



102
103
104
# File 'lib/active_record/errors.rb', line 102

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

Class Method Details

.hostname_error(hostname) ⇒ Object



107
108
109
110
111
112
# File 'lib/active_record/errors.rb', line 107

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

.username_error(username) ⇒ Object



114
115
116
117
118
119
# File 'lib/active_record/errors.rb', line 114

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