Exception: ActiveRecord::DatabaseConnectionError
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
ActiveRecord::ConnectionNotEstablished
|
Defined in: | activerecord/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.
Class Method Summary
- .hostname_error(hostname)
- .new(message = nil) ⇒ DatabaseConnectionError constructor
- .username_error(username)
ConnectionNotEstablished
- Inherited
AdapterError
- Inherited
Instance Attribute Summary
AdapterError
- Inherited
Instance Method Summary
ConnectionNotEstablished
- Inherited
Constructor Details
.new(message = nil) ⇒ DatabaseConnectionError
# File 'activerecord/lib/active_record/errors.rb', line 103
def initialize( = nil) super( || "Database connection error") end
Class Method Details
.hostname_error(hostname)
[ GitHub ]# File 'activerecord/lib/active_record/errors.rb', line 108
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)
[ GitHub ]# File 'activerecord/lib/active_record/errors.rb', line 115
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