Skip to Content.
Sympa Menu

freetds - Re: Error handling

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Brian Bruns" <camber AT ais.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: Error handling
  • Date: Fri, 14 Jun 2002 10:08:55 -0400


Bill,

What do you mean exactly? Do you want to throw a client error to the
application, ala "Query Pending"? If so you can just call
tds_client_msg(), the problem is that dbconvert() and friends can be
called without a dbproc and therefore tds_convert gets called without a
TDSSOCKET structure.

Since all messages are done within the context of a DBPROCESS or
CS_CONNECTION so that they can be routed around to the right handler,
there's no way around having one.

The obvious question then becomes should we be passing a possibly NULL
TDSSOCKET to the conversion routines. If someone calls:

dbconvert(NULL, ...)

within the code and there is an error, then no message can be sent
(there's no way to figure out which handler to send it to), nor should it
since it would be incompatible with Sybase's implementation. However,
during binds and such when tds_convert is called directly, we would
necessarily already have a valid TDSSOCKET.

Any particular reason for pushing as a client message vs. logging it to
TDSDUMP?

Brian

> Brian/James/Anybody,
>
> I want to put some error handling into convert.c, and I'm a bit baffled
> about how to do it. I can see that token.c does something with this, but I
> don't really understand what's happening (despite the detailed comments!)
>
> Could you give me a quick pointer on what to do ?
>
> Thanks,
>
> Bill




Archive powered by MHonArc 2.6.24.

Top of Page