Exception handling, FTP and IDE editor bug

Hi,
  I am currently writing a simple FTP client using Netmanage's FTP control.
What I am trying to do is to handle an exception using the try-except-end
protected block:

try
  Connect (Task);
  Authenticate (Task);
  Disconnect (Task);
except
  on Exception do ShowMessage ('An exception has occured');
end;

An exception is raised in the event handler of the FTP component if the FTP
server disconnected:

procedure FTP.FTPStateChanged(Sender: TObject; State: Smallint);
begin
  if State=prcDisconnected then raise Exception.Create ('Test')
end;

The problem is that since the exception is not raised inside the protected
block (it's raised inside an event handler) it's not handled and reaches the
Application level.

How can I fix this?

Any sample code and/or suggestions are very appreciated.

P.S. Adding the at reserved word after the raise statement did not make
things any better either. The IDE editor for some reason does not even
highlight the "at" reserved word.

Vitaly.
vit...@idirect.com