HomeDelphiDelphi Error – E2125 EXCEPT or FINALLY expected

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

You May Also Like

Delphi Compiler Error X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...