-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

> Is there a way to distinguish the error I get from various methods (eg.
> connect) besides parsing the text? I try few connect errors (wrong user,
> wrong port) and the error code returned is 1 (DBI::err) and state is
> 25P01 (DBI::state) and the error string is vary.

The connect() method is much different from the other methods: once you 
are actually connected, you can get better error codes from the server 
itself. For the connect method, however, you'll need to parse the errstr 
yourself. Luckily, there is a fairly finite number of common connection 
errors.

Once connected, you can rely upon the $dbh->state() method to return 
something reasonable. Be aware, however, that these codes were developed 
by committee and are not usually very specific or useful. The list is here:

http://developer.postgresql.org/pgdocs/postgres/errcodes-appendix.html

Note that only a handful of those will appear in 99% of all errors.

- --
Greg Sabino Mullane [EMAIL PROTECTED]
End Point Corporation
PGP Key: 0x14964AC8 200708191130
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFGyGIrvJuQZxSWSsgRAyOVAJoD3U4w4kDT1Kql1ZuksmqtqgG50QCg1kk2
rzRDO77d9Xm+3iHDbhdlQrI=
=01ee
-----END PGP SIGNATURE-----


Reply via email to