Arno,

I think you know this bether than me, but I think you are right. Calling 
RequestDone with errormessage would also solve the problem for me.

Regards Bjørnar

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arno Garrels
Sent: 7. april 2008 12:15
To: ICS support mailing
Subject: Re: [twsocket] SMTPProt.pas

Bjørnar,

Won't it be smarter to trigger RequestDone with an error and the
exception message?
Someting like:

procedure TCustomSmtpClient.DoHighLevelAsync;
[..]
    try
        [..]
    except
        on E:Exception do begin
          {$IFDEF TRACE}
            TriggerDisplay('! ' + E.ClassName + ': "' + E.Message + '"');
          {$ENDIF}
            FHighLevelResult := 427; // Just invented this error number 
hopefully not in use
            FRequestResult   := 427;
            FErrorMessage    := '427 ' + E.ClassName + ': "' + E.Message + '"';
        end;
    end;                                     {Bjørnar}

    {$IFDEF TRACE} TriggerDisplay('! HighLevelAsync done'); {$ENDIF}
    FFctSet          := [];
    FNextRequest     := nil;
    FRequestDoneFlag := FALSE;
    TriggerRequestDone(FHighLevelResult);
end;

Bjørnar Nielsen wrote:
> I think there is a wakness/bug in the smtpprot.pas:
>
> procedure TCustomSmtpClient.RcptTo;
>
> begin
>
>     if FRcptName.Count <= 0 then
>
>         raise SmtpException.Create('RcptName list is empty');
>
>
>
>     FItemCount := -1;
>
>     RcptToNex
>
>
>
> When this exception is raised, I cant catch it anywhere. No
> bgexception, no requestdone. I added try/except in this procedure
> (all the code in this procedure inside the try):
>
> procedure TCustomSmtpClient.DoHighLevelAsync;
>
>  like this:
>
>     except                                  {Bjørnar}
>
>       on E:Exception do                     {Bjørnar}
>
>           HandleBackGroundException(E);     {Bjørnar}
>
>     end;                                    {Bjørnar}
>
>
>
> then I was able to catch it and shut down and release the
> smtp-component. Any comments on this change?
>
>
>
> Regards Bjørnar
>
>
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.22.5/1356 - Release Date:
> 02.04.2008 16:14
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.8/1362 - Release Date: 06.04.2008 
11:12


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.8/1362 - Release Date: 06.04.2008 
11:12

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to