freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] Getting error messages to the (PHP) user
- From: "James K. Lowden" <jklowden AT freetds.org>
- To: freetds AT lists.ibiblio.org
- Subject: Re: [freetds] Getting error messages to the (PHP) user
- Date: Tue, 5 Mar 2013 10:45:34 -0500
On Tue, 05 Mar 2013 09:18:31 -0500
"Mark A. Hershberger" <mah AT everybody.org> wrote:
> I found that _dblib_handle_info_message() in dbutil.c handles both
> actions: logging the actual SQL Server error message and returning the
> hard-coded error message ("General SQL Server error...").
>
> This hard-coded error message seems pretty useless to me -- especially
> when the actual error message is right there. Is there a reason it
> was done this way?
I think you'll find, if you look again, that the hard-coded message is
in response to a severity > 10. db-lib distinguishes between *message*
arriving from the server, and *errors* returned because of improper use
of the API. Errors happen without the server; messages come from the
server.
Server messages arrive with a severity code. By convention, severity
codes >= 10 are "errors" in the sense that the user can't fix them.
select count(*), severity from sys.sysmessages group by severity order
by severity;
severity
----------- --------
1130 0
13260 10
1460 11
10 12
10 13
700 14
2290 15
55490 16
530 17
90 18
50 19
890 20
430 21
70 22
140 23
90 24
The message handler treats such messages as errors. Instead of
repeating the text of the message, it says to check for messages.
Which makes a certain amount of sense if you can keep messages and
errors straight in your mind.
--jkl
-
[freetds] Getting error messages to the (PHP) user,
Mark A. Hershberger, 03/05/2013
-
Re: [freetds] Getting error messages to the (PHP) user,
James K. Lowden, 03/05/2013
-
Re: [freetds] Getting error messages to the (PHP) user,
Mark A. Hershberger, 03/05/2013
- Re: [freetds] Getting error messages to the (PHP) user, James K. Lowden, 03/05/2013
-
Re: [freetds] Getting error messages to the (PHP) user,
Mark A. Hershberger, 03/05/2013
-
Re: [freetds] Getting error messages to the (PHP) user,
James K. Lowden, 03/05/2013
Archive powered by MHonArc 2.6.24.