There are no code modifications necessary.* Your program is already catching the expected exception.
What you're seeing is the debugger intercepting the exception as soon as it's thrown, before your program gets a chance to see that an exception exists and do anything about it. When the IDE intrerrupts you, it shows a dialog box giving you the option to continue running. Exercise that option, or press the "Run" button after you dismiss the dialog box.
You can configure the debugger to ignore some or all exceptions, which is especially helpful when using Indy, which tends to use exceptions for normal flow control. How to do that has been covered here before.
* Remy's answer describes improvements you can make to your code to catch other possible exceptions.