PDA

View Full Version : Safecall and log file.


ntodorov
20-Sep-2005, 04:33 PM
Hi!

I have Appserver (remote data modules, midas) and I want to know are there any options to more detailed control showing and logging exceptions?
I use this: Show exception dialog – false, it is needed because my AppServer runs on a remote PC using DCOM. The problem is that:

Procedure TMyRemoteDataModule.Test;
//declared as safecall or not – result is the same
begin
raise Exception.Create(‘exception here’);
//Dons’t raise up on Client app, only saved on AppServer-exe.elf
end;
but ->


Procedure TMyRemoteDataModule.Test;
//declared as safecall or not – result is the same
Begin
try
raise Exception.Create(‘exception here’);
finally
raise;
end;
//Raised on Client app, and not saved on AppServer-exe.elf
end;

My question is : Can Eureka send all raised exceptions (safecall or not) to client side (without try/except construction)? And is there eureka option for logging every exception?
I need to show every exception on client side and log it on AppServers elf.

admin
23-Sep-2005, 07:51 AM
ntodorov wrote:
> Hi!
>
> I have Appserver (remote data modules, midas) and I want to know are
> there any options to more detailed control showing and logging
> exceptions?
> I use this: Show exception dialog – false, it is needed because my
> AppServer runs on a remote PC using DCOM. The problem is that:
>
>
> Code:
> --------------------
> Procedure TMyRemoteDataModule.Test;
> //declared as safecall or not – result is the same
> begin
> raise Exception.Create(‘exception here’);
> //Dons’t raise up on Client app, only saved on AppServer-exe.elf
> end;
> --------------------
>
> but ->
>
>
>
> Code:
> --------------------
> Procedure TMyRemoteDataModule.Test;
> //declared as safecall or not – result is the same
> Begin
> try
> raise Exception.Create(‘exception here’);
> finally
> raise;
> end;
> //Raised on Client app, and not saved on AppServer-exe.elf
> end;
> --------------------
>
>
> My question is : Can Eureka send all raised exceptions (safecall or
> not) to client side (without try/except construction)?

Handled all raised exception in client side it's really impossible. How
can client handle exceptions raised only in the server?

> And is there eureka option for logging every exception?

No, I'm sorry.

> I need to show every exception on client side and log it on AppServers
> elf.

If the server is placed in a local network you can save all the
exception logs in a unique .elf file, setting the EurekaLog Output File
to a specific net path (ex: '\\pc_server\c\logs\project_name.elf').


--
Best regards...

Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.

ntodorov
03-Oct-2005, 07:03 AM
> >My question is : Can Eureka send all raised exceptions (safecall or
>> not) to client side (without try/except construction)?

>Handled all raised exception in client side it's really impossible. How
>can client handle exceptions raised only in the server?

COM(DCOM) sends exceptions to server, when exception is in safecall method. The problem is that eureka prevent this in some cases (see first post). Is it a bug?

admin
03-Oct-2005, 08:33 AM
ntodorov wrote:
>>>My question is : Can Eureka send all raised exceptions (safecall or
>>>not) to client side (without try/except construction)?
>
>
>>Handled all raised exception in client side it's really impossible.
>
> How
>
>>can client handle exceptions raised only in the server?
>
>
> COM(DCOM) sends exceptions to server, when exception is in safecall
> method. The problem is that eureka prevent this in some cases (see
> first post). Is it a bug?

It isn't a bug but an EurekaLog behavior.

EurekaLog handled every exception raised into a SafeCall method before
that the Client send the exception to the Server, to avoid to lose the
original Client call-stack.

The Server shows only its internal call-stack hiding the original Client
call-stack!

BTW in the next versions I'll add a new options so to choose if use or
not this behavior.

I hope to have answered to your question, otherwise don't hesitate to
recontact to me, ok? :)

--
Best regards...

Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.

ntodorov
04-Oct-2005, 07:44 AM
It would be cool to have this option! :)

Because now I can’t use Eureka on my old app servers – every method must be in try/except, otherwise some exception are only logged and users aren’t got informed. Any ideas to workaround this?

admin
04-Oct-2005, 05:07 PM
ntodorov wrote:
> It would be cool to have this option! :)
>
> Because now I can’t use Eureka on my old app servers – every method
> must be in try/except, otherwise some exception are only logged and
> users aren’t got informed. Any ideas to workaround this?

No, I'm sorry.
I haven't planned it again.

But if you want I can suggest to you the source modifications needed to
can change the standard EurekaLog behavior.

--
Best regards...

Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.

ntodorov
11-Oct-2005, 11:17 AM
But if you want I can suggest to you the source modifications needed to
can change the standard EurekaLog behavior.



Yes, tell me please.

admin
12-Oct-2005, 01:39 PM
ntodorov wrote:
> admin Wrote:
>
>>
>>But if you want I can suggest to you the source modifications needed
>>to
>>can change the standard EurekaLog behavior.
>>
>>
>
>
> Yes, tell me please.

Replace the ExceptionLog.ExceptionTypeByAddr function with the following:


//--------------------------------------------------------
function ExceptionTypeByAddr(Addr: DWord): TExceptionType;
var
GoAddr: DWord;
begin
Result := etUnknown;
Inc(Addr);
if IsValidBlockAddr(Addr, SizeOf(Addr)) then
begin
GoAddr := ConvertAddress(Addr + PDWord(Addr)^ + 4);
if (GoAddr = HandleAnyExceptionAddr_Variable) then
Result := etHandleAnyException
else
if (GoAddr = HandleOnExceptionAddr_Variable) then
Result := etHandleOnException
{ else
if (GoAddr = HandleAutoExceptionAddr_Variable) then
Result := etHandleAutoException;}
end;
end;
//--------------------------------------------------------

--
Best regards...

Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.