|
|
sybperl-l Archive
Up Prev Next
From: Hrvoje Niksic <hniksic at iskon dot hr>
Subject: Verbosity of DBD::Sybase
Date: Nov 16 1999 10:53AM
I noticed that DBD::Sybase is verbose when an error is encountered,
which results in repeating error messages with correctly written
code. Let's take an example from the _Short guide to DBI_, with
cosmetic adaptations to Sybase:
use DBI;
my $dbh = DBI->connect('DBI:Sybase:INTENTIONALLY-BOGUS')
or die "Couldn't connect to database: " . DBI->errstr;
The printed error message looks like this:
DBI->connect failed: OpenClient message: LAYER = (6) ORIGIN = (8) SEVERITY = (5) NUMBER = (3)
Message String: ct_connect(): directory service layer: internal directory control layer error: Requested server name not found.
at test.pl line 3
Couldn't connect to database: OpenClient message: LAYER = (6) ORIGIN = (8) SEVERITY = (5) NUMBER = (3)
Message String: ct_connect(): directory service layer: internal directory control layer error: Requested server name not found.
Obviously, the actual error message (OpenClient message: LAYER = ...)
is printed twice, and that's not what I expected. What I'd like to
get is an error message that looks like this:
Couldn't connect to database: ... error-string, potentially long and
spanning several lines ...
at test.pl line 3
So, is there a way to turn off printing of error messages by default,
so that my routines can pick them up and print them the way I want it?
|