Skip to Content.
Sympa Menu

freetds - Re: [freetds] 0.82 RC4 assert(0) on failed to connect

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] 0.82 RC4 assert(0) on failed to connect
  • Date: Mon, 21 Apr 2008 14:17:57 -0400

Dossy Shiobara wrote:
> > For the sake of a framework, let's say errors are of two kinds:
> > logical and runtime. Runtime errors -- server not available, library
> > misuse -- cannot be handled at compile time. They provoke error
> > messages that inform the user what went wrong. Logical errors are
> > bugs embedded in the code that can be prevented by testing, etc. They
> > are handled more simply: with a log message (maybe) and an assertion.
> > (I'm excluding server messages -- bad SQL, etc. -- because they're not
> > errors insofar as the library is concerned. They're just data.)
>
> It would be nice if in the TDSMESSAGE structure there was an "error
> code" passed along. Having to parse the error message string (esp. once
> things get localized, yow!) to deduce "what went wrong" is going to be
> very ... painful.

I think what you're looking for is TDSMESSAGE::msgno. tdserror writes its
third argument to that member. See also the tds_error_messages on line
249 of src/tds/util.c.

--jkl






Archive powered by MHonArc 2.6.24.

Top of Page