Internet Direct (Indy) Version 9.0.2 Beta
TIdTCPServer.ReplyExceptionCode
Specifies the numeric result code used after an exception.

property ReplyExceptionCode: Integer;
Description
ReplyExceptionCode is an Integer property that specifies the numeric result code used when an exception is raised in the server context during dispatch and execution of a command handler in IdCommandHandler.Check. An exception may also use the ReplyExceptionCode in a command handler, if the exception occurs during execution of the associated TIdCommand.

ReplyExceptionCode and the text from the exception message are written to the client connection when the exception is trapped.