[fpc-pascal] FPCUnit test + raise E;

Marcos Douglas md at delfire.net
Mon Sep 23 22:52:26 CEST 2013


On Thu, Sep 19, 2013 at 1:44 AM, Sven Barth <pascaldragon at googlemail.com> wrote:
> Am 18.09.2013 23:34 schrieb "Marcos Douglas" <md at delfire.net>:
>
>
>>
>> On Tue, Sep 17, 2013 at 2:41 PM, Sven Barth <pascaldragon at googlemail.com>
>> wrote:
>> > On 17.09.2013 17:27, Marcos Douglas wrote:
>> >>
>> >> On Tue, Sep 17, 2013 at 12:18 PM, Marcos Douglas <md at delfire.net>
>> >> wrote:
>> >>>>
>> >>>> Another thing you could try (just for testing): change your exception
>> >>>> handler procedure to a function that returns bool and use it like
>> >>>> this:
>> >>>>
>> >>>> === code begin ===
>> >>>>
>> >>>>
>> >>>> procedure TghSQLConnector.Connect;
>> >>>> begin
>> >>>>    try
>> >>>>      FLib.Connect;
>> >>>>    except
>> >>>>      on E: Exception do
>> >>>>        if not DoOnException(E) then
>> >>>>          raise;
>> >>>>    end;
>> >>>> end;
>> >>>>
>> >>>> === code end ===
>> >>>>
>> >>>>
>> >>>> Regards,
>> >>>> Sven
>> >>>
>> >>>
>> >>> The only difference is the use of raise; instead raise E; right?
>> >>>
>> >>> Marcos Douglas
>> >>
>> >>
>> >> In project in attachment before, if you change the line 50
>> >> from:
>> >>      raise E;
>> >>
>> >> to:
>> >>      raise Exception.Create(E.Message);
>> >>
>> >> Will work... but is this correct?
>> >
>> >
>> > So this seems to be indeed a problem of freeing exceptions. Whether you
>> > misuse the exception system or you encountered a bug needs to be
>> > determined...
>>
>> If this is a bug I can register in bug tracker.
>
> I don't know yet whether it's a bug or a mistake...
>
>>
>> >> Lazarus 1.1 r42461 FPC 2.6.2 i386-win32-win32/win64
>> >
>> >
>> > Could you test your original one with 2.7.1 as well?
>>
>> I can't compile Lazarus with FPC 2.7.1 (as you saw in lazarus-list)
>> so, I can't test...  :(
>
> It's ok if you use a 2.7.1 before the merge of the cpstrrtl branch. There
> AFAIK weren't any exception related changes since then.

For now I resolved use re-raise the original Exception using FPC 2.6.2.

Thank you again.

Marcos Douglas



More information about the fpc-pascal mailing list