當無法建立資料庫連線(因為無法連線至主機或授權失敗)時引發。
方法
- H
- N
- U
類別公開方法
hostname_error(hostname) 連結
來源:顯示 | 在 GitHub 上
# File activerecord/lib/active_record/errors.rb, line 99 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
new(message = nil) 連結
來源:顯示 | 在 GitHub 上
# File activerecord/lib/active_record/errors.rb, line 94 def initialize(message = nil) super(message || "Database connection error") end
username_error(username) 連結
來源:顯示 | 在 GitHub 上
# File activerecord/lib/active_record/errors.rb, line 106 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