Le 16/01/2014 23:12, Ian Haywood a écrit :
> I have discovered that Error.Backtrace is not always correctly set.
> if an error occurs in a TRY expression Error.Backtrace remains with the
> previous error.
> Error.Where and Error.Text are set correctly.
>
> This caused us a lot of problems as we log Error.backtrace to find
> errors on user systems.
>
> I attach a mini-project that demonstrates this.
>
>

This is for performance reasons. Storing the stack backtrace can be an 
heavy process, so it is only done if there is a CATCH or a FINALLY or no 
error handler in the function.

For a TRY that does not call functions, it is not computed, so you get 
the previous stack backtrace.

I admit it is actually a bit weird, but I don't understand why it is a 
problem. You should use TRY when you really don't care with the error.

Anyway I will think about it. How to get a stack backtrace in all cases 
without having to copy the entire stack, most of the time for nothing.

-- 
Benoît Minisini

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to