Exception: DataObjects::SQLError
- Defined in:
- lib/data_objects/error/sql_error.rb
Direct Known Subclasses
ConnectionError, DataError, IntegrityError, SyntaxError, TransactionError
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#sqlstate ⇒ Object
readonly
Returns the value of attribute sqlstate.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(message, code = nil, sqlstate = nil, query = nil, uri = nil) ⇒ SQLError
constructor
A new instance of SQLError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, code = nil, sqlstate = nil, query = nil, uri = nil) ⇒ SQLError
Returns a new instance of SQLError.
10 11 12 13 14 15 16 |
# File 'lib/data_objects/error/sql_error.rb', line 10 def initialize(, code = nil, sqlstate = nil, query = nil, uri = nil) @message = @code = code @sqlstate = sqlstate @query = query @uri = uri end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/data_objects/error/sql_error.rb', line 5 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/data_objects/error/sql_error.rb', line 4 def @message end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
7 8 9 |
# File 'lib/data_objects/error/sql_error.rb', line 7 def query @query end |
#sqlstate ⇒ Object (readonly)
Returns the value of attribute sqlstate.
6 7 8 |
# File 'lib/data_objects/error/sql_error.rb', line 6 def sqlstate @sqlstate end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
8 9 10 |
# File 'lib/data_objects/error/sql_error.rb', line 8 def uri @uri end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/data_objects/error/sql_error.rb', line 18 def to_s "#{} (code: #{code}, sql state: #{sqlstate}, query: #{query}, uri: #{uri})" end |