Delphi Error – E2125 EXCEPT or FINALLY expected

Delphi Compiler Error

E2125 EXCEPT or FINALLY expected

Reason for the Error & Solution

The compiler was expecting to find a FINALLY or EXCEPT keyword, during the processing of exception handling code, but did not find either.

program Produce;

begin
  try
  end;
end.

In the code above, the ‘except’ or ‘finally’ clause of the exception handling code is missing, so the compiler will issue an error.

program Solve;

begin
  try
  except
  end;
end.

By adding the missing clause, the compiler will be able to complete the compilation of the code. In this case, the ‘except’ clause will easily allow the program to finish.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error E2313 Attribute – Known attribute cannot specify properties Reason for the Error & Solution No further information...
Delphi Compiler Error E2379 Virtual methods not allowed in record types Reason for the Error & Solution No further information...
Rodrigo , one of the long time Delphi Developer has been working on one of his personal project “Delphi IDE...