Exception: ActiveRecord::StatementInvalid
- Inherits:
-
ActiveRecordError
- Object
- StandardError
- ActiveRecordError
- ActiveRecord::StatementInvalid
- Defined in:
- lib/active_record/errors.rb
Overview
Superclass for all database execution errors.
Wraps the underlying database error as cause
.
Direct Known Subclasses
NoDatabaseError, PreparedStatementCacheExpired, ValueTooLong, WrappedDatabaseException
Instance Method Summary collapse
-
#initialize(message = nil, original_exception = nil) ⇒ StatementInvalid
constructor
A new instance of StatementInvalid.
- #original_exception ⇒ Object
Constructor Details
#initialize(message = nil, original_exception = nil) ⇒ StatementInvalid
Returns a new instance of StatementInvalid.
100 101 102 103 104 105 106 107 |
# File 'lib/active_record/errors.rb', line 100 def initialize( = nil, original_exception = nil) if original_exception ActiveSupport::Deprecation.warn("Passing #original_exception is deprecated and has no effect. " \ "Exceptions will automatically capture the original exception.", caller) end super( || $!.try(:message)) end |
Instance Method Details
#original_exception ⇒ Object
109 110 111 112 |
# File 'lib/active_record/errors.rb', line 109 def original_exception ActiveSupport::Deprecation.warn("#original_exception is deprecated. Use #cause instead.", caller) cause end |