Exception: PG::Error
- Inherits:
-
StandardError
- Object
- StandardError
- PG::Error
- Defined in:
- ext/pg.c,
lib/pg/exceptions.rb,
ext/pg_errors.c
Overview
This is the exception class raised when an error is returned from a libpq API call.
The attributes connection
and result
are set to the connection object and result set object, respectively.
If the connection object or result set object is not available from the context in which the error was encountered, it is nil
.
Direct Known Subclasses
ConnectionBad, InvalidChangeOfResultFields, InvalidResultStatus, LostCopyState, NoResultError, NotAllCopyDataRetrieved, NotInBlockingMode, ServerError, UnableToSend
Instance Attribute Summary collapse
- #connection ⇒ Object readonly
- #result ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(msg = nil, connection: nil, result: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(msg = nil, connection: nil, result: nil) ⇒ Error
Returns a new instance of Error.
10 11 12 13 14 |
# File 'lib/pg/exceptions.rb', line 10 def initialize(msg=nil, connection: nil, result: nil) @connection = connection @result = result super(msg) end |