Feature Requests: Browse | Submit New | Admin

[#26766] When „rescueing” a DBI::ProgrammingError the error code should be contained

Date:
2009-07-27 13:40
Priority:
3
Submitted By:
Nobody
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
When „rescueing” a DBI::ProgrammingError the error code should be contained

Detailed description
Hi,

when „rescueing” a DBI::ProgrammingError when using DBD::Pg, the database error code should be accessable via
esception.err. Actually it's not: .err is nil and .inspect/pp doesn't show the error code, either.

Greetings,
 CK

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-10-25 03:29
Sender: Mike Pomraning

I thought dbi_ex.err was for the native error object (PGError,
in this case), and .state was for the SQLSTATE error code (if
supported).  In any case, the dbd-pg driver could set these members
more and more consistently.

See also ruby-dbi tracker #27227 (DBI::DBD API improvement -
unified error handling in DBI).
Date: 2009-07-28 04:24
Sender: Daniel Berger

I agree that the error code should be accessible as a separate
attribute (perhaps DBI::Excetion#error_code) for those vendors
that support error codes. Whether this should remain a string,
or converted to an integer is another matter, as I am not entirely
familiar with the error codes for vendors outside of Postgres
and Oracle.

Regards,

Dan

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
category_id0.4.12009-07-28 04:22erikh
assigned_toerikh2009-07-28 04:22erikh