Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Proper Exception Checking
Mon, Apr 16 2007 9:24 PMPermanent Link

"Lance R"
I'm using a Client / Server app.

I need to make sure that the server is actually running before creating /
deleting tables.

I put in, temporarily, this messy code below and turned off the server.

I'm getting a generic 10061 socket error first in the IDE, then and
EEDBException 1100 error, then the EEDBException 1100 error again.
I then hit my exception checking, to which it falls to the catchall "unknown
error".

Am I missing something or would there be a better recommendation to check?

Lance


==============================
 try
    Result:=FALSE;
    datamod.SessionSetup;
    DataMod.MyDatabase.SessionName := mySessionName;
    DataMod.MySession.Connected := TRUE;
 except

    on E: Exception do begin
       if (E is EEDBException) then begin
          if (EEDBException(E).ErrorCode=EDB_ERROR_CLIENTCONN) then begin
             showmessage('Could not locate the database server. ' +
                         'Be sure it is running and the configuration
settings are correct.');
          end
          else if (EEDBException(E).ErrorCode=EDB_ERROR_CLIENTLOST) then
begin
             showmessage('Lost the database server connection. ' +
                         'Be sure it is running and the configuration
settings are correct.');
          end

          else begin
             ShowMessage('Unknown or unexpected database engine error # '+
       IntToStr(EEDBException(E).ErrorCode));
          end
       end
       else begin
           ShowMessage('Unknown or unexpected error has occurred.');
       end;
    end;

 end;

Tue, Apr 17 2007 5:49 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Lance,

<< I'm getting a generic 10061 socket error first in the IDE, then and
EEDBException 1100 error, then the EEDBException 1100 error again.I then hit
my exception checking, to which it falls to the catchall "unknown
error".

Am I missing something or would there be a better recommendation to check?
>>

You don't want the EEDBException object, that is used internally by EDB in
the engine.  What you want is the EEDBError exception object that is defined
in the edbcomps.pas unit (source provided with every EDB install).

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Apr 17 2007 7:35 PMPermanent Link

"Lance R"
Thanks Tim,

I'll try that one....

Lance



"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:2AAA433F-2616-4B10-9C18-D6D48D45C5CD@news.elevatesoft.com...
> Lance,
>
> << I'm getting a generic 10061 socket error first in the IDE, then and
> EEDBException 1100 error, then the EEDBException 1100 error again.I then
> hit my exception checking, to which it falls to the catchall "unknown
> error".
>
> Am I missing something or would there be a better recommendation to check?
> >>
>
> You don't want the EEDBException object, that is used internally by EDB in
> the engine.  What you want is the EEDBError exception object that is
> defined in the edbcomps.pas unit (source provided with every EDB install).
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>

Tue, Apr 17 2007 8:14 PMPermanent Link

"Lance R"
That did it.

Thanks Tim!

Lance


"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:2AAA433F-2616-4B10-9C18-D6D48D45C5CD@news.elevatesoft.com...
> Lance,
>
> << I'm getting a generic 10061 socket error first in the IDE, then and
> EEDBException 1100 error, then the EEDBException 1100 error again.I then
> hit my exception checking, to which it falls to the catchall "unknown
> error".
>
> Am I missing something or would there be a better recommendation to check?
> >>
>
> You don't want the EEDBException object, that is used internally by EDB in
> the engine.  What you want is the EEDBError exception object that is
> defined in the edbcomps.pas unit (source provided with every EDB install).
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>

Image