Skip to content

Commit fa41e5f

Browse files
committed
Add more explicit NotImplementedErrors in AbstractAdapter
Adding this so that when folks are adding a new db adapter and run into an error it is explicit for what is not implemented.
1 parent 065ba4f commit fa41e5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/lib/active_record/connection_adapters/abstract_adapter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def self.find_cmd_and_exec(commands, *args) # :doc:
119119

120120
# Opens a database console session.
121121
def self.dbconsole(config, options = {})
122-
raise NotImplementedError
122+
raise NotImplementedError.new("#{self.class} should define `dbconsole` that accepts a db config and options to implement connecting to the db console")
123123
end
124124

125125
def initialize(config_or_deprecated_connection, deprecated_logger = nil, deprecated_connection_options = nil, deprecated_config = nil) # :nodoc:
@@ -1084,7 +1084,7 @@ def backoff(counter)
10841084
end
10851085

10861086
def reconnect
1087-
raise NotImplementedError
1087+
raise NotImplementedError.new("#{self.class} should define `reconnect` to implement adapter-specific logic for reconnecting to the database")
10881088
end
10891089

10901090
# Returns a raw connection for internal use with methods that are known

0 commit comments

Comments
 (0)