Another idea: If you enable MACRO's and ASSERT's you can define macros for each of your exceptions.
{$MACRO ON}
{$ASSERTIONS ON}
{$DEFINE RAISE_NOT_FOUND := Assert(False, 'Not Found @ ' + Self.ClassName + '[' + Self.Name + ']')}
{$DEFINE RAISE_OUT_OF_RANGE := Assert(False, 'Out Of Range @ ' + Self.ClassName + '[' + Self.Name + ']')}
Then just add an exception like this:
procedure TForm1.Button1Click(Sender: TObject);
begin
RAISE_NOT_FOUND;
end;
The cool thing about this is, you can always change your exceptions for release, by changing the macros.
*EDIT*: Scrap that. The line number is the line number of the macro define. Dang