Neither. It's nothing specific to ZSQLMethods; in a try/except context, the errors for everything (all Zope errors, not just DB errors) are put in error_value. See the help for the dtml-try tag for other info. Glad to have helped. Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Knowledge Management & Technology Consultant
-----Original Message----- From: Colin Fox [mailto:cfox@crystalcherry.com] Sent: Wednesday, March 20, 2002 8:03 PM To: Joel Burton Cc: zope@zope.org Subject: RE: [Zope] ZSQL Errors
Thanks - I'm also using zpsycopg. This is exactly what I was looking for!
Is this documented anywhere, or is this a new feature?
On Tue, 2002-03-19 at 07:50, Joel Burton wrote:
<dtml-try> <dtml-in select> <dtml-var show> </dtml-in> <dtml-except> <dtml-var error_value> </dtml-try>
If there's an SQL error raised by PostgreSQL, you'll get the error message in error_value. If you don't use the try/except wrap, Zope will raise an error which shows the PG error.
Zope 2.5.0; PG 7.3cvs (but should be the same w/earlier versions of PG). I'm using zpysopg; this might be quite different with other PG adapters.
-- Colin Fox cfox@crystalcherry.com CF Consulting Inc. GPG Fingerprint: D8F0 84E7 E7CC 5C6C 9982 F1A7 A3EB 6EA3 BC97 572F