Back

PRF011

Excessive exception handling

Object Pascal — Delphi & Free Pascal
Info
Performance

Many try blocks in one method suggest exceptions used as flow control, which is slow

many try blocks in one method suggest exceptions used as flow control, which is slow.

Why this severity

many try blocks in one method suggest exceptions used as flow control, which is slow.


Known false positives

methods wrapping multiple independent external calls that each need isolation.

Remediation example

if TryStrToInt(S, V) then
  Process(V);
// avoid try/except for expected parsing failures

Reconnecting… Connection lost. Reload