Improve handling of LoadErrors with the oracle adapter. Closes #6780 [kubo]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5956 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Michael Koziarski
2007-01-16 01:31:25 +00:00
parent 6d37c638e7
commit 8437be3380
2 changed files with 4 additions and 3 deletions

View File

@@ -265,7 +265,7 @@ module ActiveRecord
column_type_sql << "(#{precision})"
end
else
raise ArgumentError, "Error adding decimal column: precision cannot be empty if scale if specifed" if scale
raise ArgumentError, "Error adding decimal column: precision cannot be empty if scale if specified" if scale
end
column_type_sql
else

View File

@@ -676,13 +676,14 @@ rescue LoadError
# OCI8 driver is unavailable.
module ActiveRecord # :nodoc:
class Base
@@oracle_error_message = "Oracle/OCI libraries could not be loaded: #{$!.to_s}"
def self.oracle_connection(config) # :nodoc:
# Set up a reasonable error message
raise LoadError, "Oracle/OCI libraries could not be loaded."
raise LoadError, @@oracle_error_message
end
def self.oci_connection(config) # :nodoc:
# Set up a reasonable error message
raise LoadError, "Oracle/OCI libraries could not be loaded."
raise LoadError, @@oracle_error_message
end
end
end