in Delphi Exceptions :: This is the second (first here) article in a series I've devoted to exceptions and handling them. An exception is a special conditions in your code requiring special handling.
A discussion on how to handle and what happens when you handle exceptions in your Delphi code is provided as the intro article. This time, we'll see how you can explore exceptions being raised and handled and how to properly re-raise exceptions.
Read the full article to learn how to Re-Throw Exceptions In Delphi Exception Handling Blocks
Related:

Hello! I often use next code to add additional information:
try
raise Exception.Create(‘Error Message’);
except
on E: Exception do
begin
E.Message := E.Message + ‘: no details’;
raise;
end;
end;
Do you think that this code can bring Access Violation?
Thanks.
@Konstantin:
Why on earth should the exception handling add additional informations? The part that raises the exception is responsible for doing that – either by raising specific exceptions and/or providing a more detailed error message.
@Konstantin: No this will not raise an AV, but “raise E;” would.
Konstantin: don’t listen to anybody, adding extended information into E.Message is a very nice patterm and is very widely used
Stephan there are times when you want to display a little more information to the end user instead of cryptic messages that another tool may leave. Good example are the ODBC messages. Some of them are just codes or states…and don’t tell the end user the problem.
One thing I do notice that beginner programmers handle to many exceptions and should only handle them when they can truly add something useful.
I use try finally more often than try except…Transaction handling is an example that is easier to read if handled in a try Finally, think most programmers use a try except.
procedure Tdm.HandleExecute;
var
a_Commit: boolean;
begin
a_Commit:= False;//set myself in error state
FConnection.BeginTrans;
try
DoStuffHere;
FQuery.Exec;
a_Commit:= True;//if I get here everything is good;
finally
if a_Commit then
FConnection.CommitTrans
else
FConnection.RollbackTrans
end;
end;